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

Thank you so much for your concentration on converting the script, PKHG!!!
Yes, there is no document for API yet, so I thought I had to wait until the official release of Blender 2.57, but it appears to be working. Are there any problems that the modified script still has?
Please share your effort if possible. I really want to look into your modified code by comparing the changes of the two.

It is correct, PKHG. Without document, I think it takes a long time to manage to make it work.

I remember that I have to mention how to animate, ora. Here is it.

    1. Place the Object that you want to animate, set the frame to 1, press key I and select Location from the menu.
    1. Place the Object where you want to move, set the frame to 2000, press key I and select Location from the menu.
    1. Change Screen lay-out from Default to Animate and see the created f-curve in Graph Editor window.
    1. Select the f-curve, press key Shift+T and select Linear from the menu.

That’s brief operations that I did in making the previous .blend file.

Not nice but used for the examples above:
http://petertregarg.host22.com/pmwiki/pmwiki.php/CSV/CsvImportAddon

Thank you very much for sharing, PKHG.
It’s already at night in Japan, and my weekend is getting over, so I will look at the script that you kindly provided deeply later.
I also saw some other major scripts to see how they are update for the latest Blender. I will learn from your modification.

おやすみ = oyasumi (schlaf gut!)

Meanwhile I understood how to use GroupProperties … the result is, that the original script is nearly unchanged …mostly the registration is adapted and the GroupPropertie classes are initialized early.

I remember that I have to mention how to animate, ora. Here is it.

    1. Place the Object that you want to animate, set the frame to 1, press key I and select Location from the menu.
    1. Place the Object where you want to move, set the frame to 2000, press key I and select Location from the menu.
    1. Change Screen lay-out from Default to Animate and see the created f-curve in Graph Editor window.
    1. Select the f-curve, press key Shift+T and select Linear from the menu.

That’s brief operations that I did in making the previous .blend file.

Thank you :slight_smile: Sorry, but I still have to ask:

Did you use a Bezier curve as the object? What view/mode should I select before attempting to press “I”?

You’ve done a lot of work, PKHG. I looked over the modified code comparing to the previous one.
It gave me the fact that there is a great change in the usage of GroupPropertie.
Out of curiosity, how did you know that about GroupPropertie? a lot of trial and errors by your own? or a good page somewhere?

Thank you for your question, ora.

> Did you use a Bezier curve as the object
No, I used the imported object, which is a mesh object containing vertices and edges.

> What view/mode should I select before attempting to press “I”
Make sure your mouse cursor is in 3D View and Object Mode when you press key I.

@Hans
No there is a info page at blender documentation (will give the link later)

By the way, your code on the wiki page (given above) is changed only slightly AND NEW!!! (if you have the old one, that is not good enough! You may have gotton a wrong impression)

Found in the doc (of the trunc)


"""
Custom Properties
+++++++++++++++++

PropertyGroups are the base class for dynamically defined sets of properties.

They can be used to extend existing blender data with your own types which can
be animated, accessed from the user interface and from python.

.. note::

   The values assigned to blender data are saved to disk but the class
   definitions are not, this means whenever you load blender the class needs
   to be registered too.

   This is best done by creating an addon which loads on startup and registers
   your properties.

.. note::

   PropertyGroups must be registered before assigning them to blender data.

.. seealso::

   Property types used in class declarations are all in :mod:`bpy.props`
"""
import bpy


class MyPropertyGroup(bpy.types.PropertyGroup):
    custom_1 = bpy.props.FloatProperty(name="My Float")
    custom_2 = bpy.props.IntProperty(name="My Int")

bpy.utils.register_class(MyPropertyGroup)

bpy.types.Object.my_prop_grp = bpy.props.PointerProperty(type=MyPropertyGroup)


# test this worked
bpy.data.objects[0].my_prop_grp.custom_1 = 22.0


@Hans

Thanks once again :slight_smile:

Should I be able to change the csv-file (for both the mesh and the f-curve) and get a new kind of a graph? I am asking this, becaue I selected a different csv-file, but nothing changes on the screen? Am I missing something elementary here?

Thank you for your further improvement, PKHG.
The piece of the code that you found is really simple and good example. From it, I understood a bit how to use PropertyGroup. Such a small example code is very helpful. Thanks again for your effort.

I will explain again about all the detailed steps of how to import a .csv file and to make a brief graph. Here is it, ora.

I assume that you’ve already installed the script successfully.

— Importing a CSV File —

    1. Find the UI of CSV Mesh Importer in the Scene panel.
    1. Specify “Point list containing X, Y, Z columns” in the “File Type” menu.
    1. Select a CSV file in the “.csv File Path:” file selection box. In this case, “fulldata.csv”
    1. Click the “Add” button and you’ll see a configuration box below.
    1. Specify the “Mesh Type” menu as “Create vertices and edges (single line)”.
    1. Specify the “X column:” number as 0.
    1. Specify the “Y column:” number as 1.
    1. Specify the “Z column:” number as 0.
    1. Click the “Import” button.
    1. You’ll see an imported mesh in the 3D view. A mesh object will automatically created there if successfully imported. If not, please send me the log text message in the console window.
    1. Select the imported object by clicking with the right mouse button.
    1. Press key N and you’ll see Properties window.
    1. Change the “Scale:” values to x = 0.01, y = 1.0, z = 0.0.

— Setting Animation —

    1. Place the imported object where you want to put by pressing key G and moving your mouse.
    1. Confirm the imported object is selected, set the frame to 1 by pressing Shift+Left Arrow.
    1. Press key I and select Location from the menu that will be shown after pressing key I.
    1. Place the imported object where you want to move by pressing key G and moving your mouse.
    1. Confirm the imported object is selected, set the frame to 2000 by pressing Shift+Up Arrow and Shift+Right Arrow several times.
    1. Press key I and select Location from the menu, again.
    1. Change Screen lay-out from Default to Animate from the top menu in Blender and you will see the created f-curve in Graph Editor window.
    1. Select the f-curve by clicking with the right mouse button, press Shift+T and select Linear from the menu that will be shown after pressing Shift+T.

Here is the .blend file, again.
http://cid-0395cf4bd1d03ae3.photos.l…esh^_ora.blend

Sorry for my bad English. I wrote it down without thinking about grammer.
To what step have you completed now? and what number in the step is your problem?
If this doesn’t work, please send me your half-created .blend file that you’re working on just right now.

Oh, it’s getting midnight. I’m in a hurry to sleep…zZZ

Thank you Hans for the guide :slight_smile: Unfortunately I can only test this on Monday. One step that I don’t quite understand (at least now) is this:

    1. Place the imported object where you want to put by pressing key G and moving your mouse.

What do you mean by “where you want to put”? If I want a graph like you made, what does this step actually mean? Do you mean the location of the object in relation to the “movie window”

What step +14. actually means is, in this case, to place the imported object in such a way that the left edge of the object is in the left corner of the graph frame.

Woohoo! :smiley: I finally understood it :smiley: Thank you soo much Hans for your effort and patience :slight_smile:

I’m glad, ora.

Some days ago, Blender 2.57 was released, and I’m working now on updating this script to work in 2.57 based on your code, PKHG. I’ll upload the script for 2.57 soon.

I updated the script for Blender 2.57.
csv_mesh_importer v0_7_alpha1.zip