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

@@CoDEmanX

Sorry for my late reply. That’s right. It will be better to place this script under File > Import in the menu. Maybe next version.

@@Jonsept

It is not what this script can do. I understand you want to import data file containing numbers and to create Text Object in Blender.
A possible workaround will be to create Text Object manually and copy and paste the text data that you want to import.

Hi Hans,

useful plugin, thank you! are you planing to update to 2.6 blender version?
BTW, unfortunately the script is OS dependent - would it be possible to wire an OS independent version of it?

all the best,

cool. this is step forward, ofcourse

Updated for Blender 2.74.
:yes:

Updated.

Download:
csv_mesh_importer v0_7_alpha4.zip

Hi.

I am new to blender and python. Can you please help me or redirect me to a tutorial where I can learn how to bring data from a CSV,XML,JSON file, so i can create a 3d Chart (for example the daily evolution of stock prices for the last 365 days ).

I have a project at work, where I need to create this chart and then to create a script that allows users to move a camera arround the chart.

The script for rotating camera I managed to assamble from different tutorials, and in works fine for a cube.
Now i need to import data from an external file : CSV,XML or JSON (preferrably the last two) and the blender to create a 3D graphic repreentation of the chart .

The chart should look something like the one in the image bellow, but instead of cubes, shoud be planes,


I tried to fallow a tutorial on https://vimeo.com/26945957 but, in doesn’t show me the entire graph , only the first one.
Plase give me a hint. (I use blender 2.74)

Hi. Me again :D.

I managed to make it work the script for moving around an object.
But when i replace the object with a bar graphic, that has text under each bar, i can’t see the text when i hit numpad 0.
Any sugestions?

Thanks.

you can use sverchok the same way with node text_out and text_in. there are some examples was… somevere here https://plus.google.com/communities/113245231013159497850

https://drive.google.com/file/d/0B6KMvjWAjGiyV2dWVTBzODZGbDQ/edit?usp=sharing
https://drive.google.com/file/d/0B6KMvjWAjGiyWE5jNWR3UHl0dWs/edit?usp=sharing
https://drive.google.com/file/d/0B6KMvjWAjGiyZ24zeVlrUzE3MGs/edit?usp=sharing

I finally managet to put it all together.
Blender 2.74. Create graphic Bar in Belnder 3D using Python an CSV data file

The code that you put in Script Page in Blender in in atcahement.
Is a mixture of english ans Spanish, but it works fine.

Look in the properties tab from script, as in image atached, and deselect Tabs and Spaces.
Now hit Run Script!

Then in the image section in blender hit T key from the keyboard, go to Mi, as shown in image atached,
put the path of the CSV file, hit read file, select for wich column you want to create graph, then hit cube or cilinder.

Here is a sample for CVS file :

Client1,2,123
Client2,3,24
Client3,5,76
Client4,6,34
Client5,8,12
Client6,2,65
Client6,5,32
Client7,1,23
Client8,12,45
Client9,4,54
Client10,11,21
Client11,3,19
Client12,9,40


Import_Data_From_CSV.blend (1.15 MB)

In atachement you will finde the blender file with the py script in in.

And here is the sample CSV code that i used :

Client1,2,123
Client2,3,24
Client3,5,76
Client4,6,34
Client5,8,12
Client6,2,65
Client6,5,32
Client7,1,23
Client8,12,45
Client9,4,54
Client10,11,21
Client11,3,19
Client12,9,40

Attachments

Import_Data_From_CSV_Cosmetizat.blend (663 KB)

To Hans:

I tested your addon in 2.78 (which i think is a release-candidat) and the sample-data you provided yielded the expected results - great work Hans!

To Costel.Sava:

Great work as well - two minor issues:

  1. line 376-377 in your script
        else:
           self.report({'INFO'}, "Please. select any object before")   

Has to be commented out (or simply deleted) - otherwise the script aborts if an object is found that is not “CURVE” or “MESH”. In my case a FONT object was found (I don’t know where it came from - apparently it’s in my startup-file)

        # else:
           # self.report({'INFO'}, "Please. select any object before")   
  1. You’re are placing the column names behind the columns instead of in front in the created objects. This means that either you can’t see the names OR you can see them backwards and mirrored (because you have to look from behind) :slight_smile:

Is it possible to draw x-y axis with axis values and labels as well?

@Hans.P.G This add-on is great! Could anyone update it for Blender 2.8x?

2 Likes

First of all, lots of thanks for the script and for the instruction to use it.

If I import the file [1_Sample_PointList.csv] that I find in the folder [Sample] no problem.

Everything goes like your tutorial.

Instead, if I:

  • only open the file [1_Sample_PointList.csv], by Numbers (I have a Mac), no modification to values of table, and I export this file (always by Numbers) to .csv,

  • import it in Blender,

I have an [Imported] object in Outliner window, but I cannot see it!

Where is it?

In the centre, but I don’t see the same points that I saw before.

The same if I modify some value in the table.

Thanks for help.

Thanks to the help of a friend, I solved.

He noted that, when I export a file from .numbers to .csv the column separator becomes ; instead ,

So I have changed from comma , to Else ;

Also, I have modified the column numbers since I want that the first column is used for the name of points (for example).

Using some tables I have obtained the wanted result

Hi! does this add/on exist for Blender 2.8? thanks!

I have the same problem.
I’m using Blender 2.9 and the scripted doesn’t work for Blender 2.9.

It hasn’t been updated but remember it’s always possible to download blender 2.79, import your csv there and then open your blend file with blender 2.91.