Page 1 of 4 123 ... LastLast
Results 1 to 20 of 75
  1. #1

    A Script to Import a CSV File and Create Meshes (for Blender 2.5x or later)

    What is CSV Mesh Importer?
    This is a Python script for Blender 2.5x or later and it imports a CSV file into Blender and creates meshes, such as vertices, edges and faces. The image below shows the UI of CSV Mesh Importer and imported meshes of a sine-curved line and a rectangle surface in 3D View window. Please watch the video to get the idea of what the script can do for your artwork.


    Name:
    CSV Mesh Importer v0.7 alpha4

    Download:
    csv_mesh_importer v0_7_alpha4.zip
    (It is being developed in SourceForge.net)

    Requirements:
    CSV Mesh Importer works as a plugin on Blender 2.5x or later. I confirmed it works well on Blender 2.74.

    Features:
    • Be able to import a CSV file and create meshes, such as vertices, edges and faces.
    • Be able to import two types of CSV files. (point list containing X, Y, Z columns and X-Y point 2D table (matrix))
    • Not Yet : Be able to import with more detailed settings of gains, bias, ...etc.
    • Not Yet : Be able to import automatically without setting in the UI.


    How to Start to Use Most Easily:
    If you want to know how to use quickly, it would be the fastest way to see this video tutorial. Also you can read the instruction below.

    --- Installing Plugin ---
    • 1. Download a file csv_mesh_importer v0_7_alpha4.zip from "Download:" link above. Then unzip it and make sure a file csv_mesh_importer.py is created.
    • 2. Close Blender if it's running.
    • 3. Put the file csv_mesh_importer.py to "%BlenderInstalledAddress%\Blender\%Version%\scrip ts\addons\". (%BlenderInstalledAddress% means the address in which Blender is installed. %Version% means Blender's version number like 2.74.)
    • 4. Start Blender.
    • 5. From the top menu, select "File -> User Preferences..." to see Blender User Preferences window.
    • 6. In the left list, select "Import-Export" item and you'll find "Import-Export: CSV Mesh Importer" in the right list.
    • 7. Click the check box of "Import-Export: CSV Mesh Importer" and make sure a check mark is placed.
    • 8. Click "Save As Default" button to keep this setting.

    --- Importing a CSV File Containing the Point List of X, Y, Z Columns ---
    • 9. Find the UI of CSV Mesh Importer in Scene panel.
    • 10. Specify "Point list containing X, Y, Z columns" in "File Type" menu.
    • 11. Select a CSV file in ".csv File Path:" file selection box. For example, use "Sample\1_Sample_PointList.csv" in the .zip file.
    • 12. Click "Add" button and you'll see a configuration box below.
    • 13. Specify "Mesh Type" menu, for example "Create vertices and edges (single line)".
    • 14. Specify "X Column:" number, for example 0.
    • 15. Specify "Y Column:" number, for example 1.
    • 16. Specify "Z Column:" number, for example 2.
    • 17. Specify "Object Name:" text box, for example "Imported".
    • 18. Click "Import" button.
    • 19. You'll see an imported mesh of a line in 3D View window.





    --- Parameters Explanations ---
    • "File Type" menu means what kind of format the CSV file has. You can import two types of format which are a point list containing X, Y, Z columns and a X-Y point 2D table (matrix).
    • "Mesh Type" menu means whether you connect the imported vertices and create edges.
    • "X Column:" number means what number of the columns in a CSV file you import as X data.
    • "Y Column:" number means what number of the columns in a CSV file you import as Y data.
    • "Z Column:" number means what number of the columns in a CSV file you import as Z data.
    • "Object Name:" text means the name of object in which you create a mesh.


    How to Import a CSV File Containing a X-Y Point 2D Table:

    --- Importing a CSV File ---
    • 1. Find the UI of CSV Mesh Importer in Scene panel.
    • 2. Specify "Point X-Y 2D table (matrix)" in "File Type" menu.
    • 3. Select a CSV file in ".csv File Path:" file selection box. For example, use "Sample\2_Sample_PointTable.csv" in the .zip file.
    • 4. Specify "Mesh Type" menu, for example "Create vertices and faces (rectangle surfaces)".
    • 5. Specify "X Length:" number, for example 1.
    • 6. Specify "Y Length:" number, for example 1.
    • 7. Specify "Z Scale:" number, for example 1.
    • 8. Specify "Object Name:" text box, for example "Imported".
    • 9. Click "Import" button.
    • 10. You'll see an imported mesh of a surface in 3D View window.





    --- Parameters Explanations ---
    • "Mesh Type" menu means whether you connect the imported vertices and create faces.
    • "X Length:" number means the X length of the grid mesh imported from a CSV file.
    • "Y Length:" number means the Y length of the grid mesh imported from a CSV file.
    • "Z Scale:" number means the Z scale factor of the grid mesh imported from a CSV file..
    • "Object Name:" text means the name of object in which you create a mesh.


    Video Tutrials:




    Recent Change Logs:
    Code:
    2015/05/10: v0.7 alpha4
      + added the checkboxes to select delimiter letters.
    2015/05/01: v0.7 alpha3
      + updated for Blender 2.74.
    2013/02/20: v0.7 alpha2
      + modified to read comments in .csv file.
    2011/04/19: v0.7 alpha1
      + updated for Blender 2.57
      + special thanks to PKHG, who made this work in Blender 2.57.
    2011/02/28: v0.6 alpha4
      + connect UI and the logic part
    2011/02/22: v0.6 alpha3
      + add parts of UI for Line and Table configs
    2011/02/20: v0.6 alpha2
      + rewrite the logic part of script to read a file and to add vertices
      + create LineMeshAdder to read a file and to add vertices and edges
      + add unit test class for LineMeshAdder
      + create TableMeshAdder to read a file and to add vertices and faces
      + add unit test class for TableMeshAdder
    2011/02/13: v0.6 alpha1
      + create a UI for the mesh import configuration
    The Differences from v0.5 beta3:
    v0.6 series are rewritten for Blender 2.5x based on the previous v0.5 beta3. It is still under development and it only has very limited features yet. The features that v0.5 beta3 has and that v0.6 series haven't yet would be added one by one in the future updates.
    Last edited by Hans.P.G.; 10-May-15 at 07:13.



  2. #2
    Hi,

    I separated the previous script of CSV Importer v0.5 beta3 into two new scripts:

    + CSV F-Curve Importer
    + CSV Mesh Importer (this script)

    It is still alpha and it has very limited features yet, and a lot of bugs, I think.
    Any comments or bug reports are welcome.

    Hans
    Last edited by Hans.P.G.; 06-Apr-11 at 04:51.



  3. #3



  4. #4
    I added the explanation on how to import a CSV file containing a X-Y point 2D table.



  5. #5
    ora provided me with a .csv file (http://koti.mbnet.fi/olliraa/fulldata.csv) and he wants to create a graph from that in Blender like the image below.
    fig.png

    I tried to import the .csv file and made a brief graph in Blender. Here are the settings of the script and the screenshot of the result.
    00117.jpg 00118.jpg

    I changed the scale to x,y,z = 0.001,1.0,0.0 after importing.

    Here is the .blend file.
    http://cid-0395cf4bd1d03ae3.photos.l...esh^_ora.blend
    Last edited by Hans.P.G.; 01-Apr-11 at 20:22.



  6. #6
    Thank you so much for the explanation This is really encouraging considering my project. I'll try this method on Monday at work



  7. #7



  8. #8
    Thank you Hans once more for the example blend-file Sorry for not answering or a few days, been sick But after seeing the example, now I understand (at least I think so) how I shoud set the axises.

    However, as always, I have one last problem:

    The rendered movie looks like it has only one frame which lasts as long as the whole movie. This single frame has the whole graph visible (image below). So, when the movie is played, nothing happens on the screen although the movie actually plays (time code changes). Naturally it should be in a way that every frame only shows "part of the graph" and the graph changes as the movie plays. Sorry, this is really hard to exlplain here.



    Could you help me once more Hans? (sorry about the unnecessary thumb below, can't find a way to delete it)
    Attached Images Attached Images
    Last edited by ora; 05-Apr-11 at 06:01.



  9. #9
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    Hi, problems with latest version of Blender SVN 36013 ... (compiled today)
    e.g. registering does not work.
    The testsuite gives no error, that is fine.
    bpy.types.IDPropertyGroup is wrong does not exist is
    probably bpy.types.PropertyGroup
    etc.
    I think you have to find out to make it work again ... ;-)



  10. #10
    Thank you, PKHG.
    I know the API of the latest Blender has changed and I guess maybe it causes the error.
    I will try to get it work again by changing IDPropertyGroup to PropertyGroup that you provided. I hope it works by only changing the name. I'm downloading the latest Blender now... Thanks again.



  11. #11
    Ok, ora. What you really want to do is not to import a curve. This is my guess, so please correct me, but you have a long curve of graph that is imported, and a part of the curve should be shown inside of the graph frame. The curve should move right to left at a constant speed as animation goes. At frame 0, the left edge of the curve is in the left corner of the graph frame and at frame 2000, the right edge of the curve is in the right corner. If that is wrong, please tell me what kind of movie you want.



  12. #12
    Originally Posted by Hans View Post
    Ok, ora. What you really want to do is not to import a curve. This is my guess, so please correct me, but you have a long curve of graph that is imported, and a part of the curve should be shown inside of the graph frame. The curve should move right to left at a constant speed as animation goes. At frame 0, the left edge of the curve is in the left corner of the graph frame and at frame 2000, the right edge of the curve is in the right corner. If that is wrong, please tell me what kind of movie you want.
    Yes, That's what I want Like I said I found it very hard to describe in text. You summed it up in a good way Hans How would I get a movie like that?



  13. #13
    Ok, ora. It seems to be easy, but you have to do something additionally.
    In a nutshell, I'll use f-curve to move the curve in Blender.
    I'll create another .blend file for that soon.



  14. #14
    Hello ora,
    I've created a .blend file in which the graph is animated. Please download from the link below and see the animation hitting Alt+A in Blender.
    http://cid-0395cf4bd1d03ae3.photos.l...nim^_ora.blend

    A f-curve was set in the x-axis to the curve object with the linear interpolation for the animation. Could it meet your goal?



  15. #15
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    @Hans, download gave a 0 bytes .blend ?
    Do you have another possibility to show the file?

    EDIT:
    got it now ...
    Last edited by PKHG; 06-Apr-11 at 07:41.



  16. #16
    A f-curve was set in the x-axis to the curve object with the linear interpolation for the animation. Could it meet your goal?
    YES! Great!

    This is just what I was looking for. I now can render a move file with the graph on it Thank you soo much!

    One more thing: If I want to repeat the thing you did with the f-curve in the future, is the exact procedure very complicated?



  17. #17
    Ok, PKHG.
    Is this works?
    http://www.esnips.com/doc/58927987-d...h_and_anim_ora

    I confirmed that I could download it from SkyDrive and open it correctly.
    If SkyDrive doen't work well, it is really inconvenient because I put all files there now.
    Last edited by Hans.P.G.; 06-Apr-11 at 08:19.



  18. #18
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    hmm, the new link will force me to use 'their' download manager (and what does that do?) but I think I got your example from cid... ;-)



  19. #19
    It implies I can use SkyDrive.
    Last edited by Hans.P.G.; 07-Apr-11 at 06:34.



  20. #20
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    Was busy to try to convert the script ... do not know but I got just a minute ago something like this:
    cvsImport.jpg

    Horrible, that there is no 'general' info about properties, panels and operators.
    I think there should be an abstract overview ...



Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •