Data Visualization in Blender and Python

CG Masters · 78K views · 2020 · 33:51

Open on YouTube

Data visualization & information designPython, Ruby & scripting languagesAnimation & visual effectstutorial

Why Blender Stack Exchange recommends it

Blender Stack Exchange users link it as a worked example of turning CSV data into Blender objects with Python, both as a starting point for their own scripts and when debugging code copied from it.

Recommended by 1 people across 1 different months, 2022 to 2022.

What it is

A 34-minute CG Masters tutorial that builds a Blender Python script to read CSV data and generate a 3D bar graph from it. It assumes little prior Python experience, though some programming background is recommended, and comes with downloadable resource files.

What people said

Recommends Blunder · 2022-12 · Blender Stack Exchange · on “index of CSV file seems to be treating 10s as the same”

Now you mentioned this I had to watch the part of the video. Indeed he does this around timestamp 13:45 [this video] . But that's not a good way to get the element's index and it only works because the unique names of the months are used. In your case, the elements are not unique in the list and it doesn't work. Better use `enumeration` as shown here Accessing the index in 'for' loops [LINK] at stackoverflow.com

Cites Santiago Sepúlveda · 2022-01 · Blender Stack Exchange · on “How to use Python in Blender to change the BEVEL modifier amount, based on a data set in csv (and distribute them in rows)?”

I have a csv list of values i want to use to change the Bevel modifier amount for a collection of a big number of cubes. I don't really know Python but tried something based on things I found in youtube, as follows: import csv import bpy bar_spacing = 1.5 bar_width = 1 with open ('C:/Users/USER/Downloads/HD1.csv') as f: readout = list(csv.reader(f)) for a in readout: placement = readout.index (a) bpy.ops.mesh.primitive_cube_add(size=1) bpy.ops.object.modifier_add(type='BEVEL') new_bar = bpy.context.object for vert in new_bar.data.vertices: vert.co[1] += 0.5 vert.co[0] += placement*bar_spacing + 0.5 new_bar.'bevel' amount = (bar.'bevel' amount, float (a[1]) I took the example from this video

Cites Sirob Snamkob · 2022-05 · Blender Stack Exchange · on “How can I assign a material based on CSV data?”

Is it possible to change color of a mesh based on external CSV data? I have a CSV file with two columns. One column must refer to/identify a mesh in the Blend file, the other columns displays a '1' or a '0'. Based on the '1' or '0', I want to assign two materials (green and red) to this mesh. Do you guys know a add-on or tutorial which (partly) covers my problem? Thanks in advance! Edit: these links helped me solve my problem: How to add color information from csv file to objects [LINK] [this video] [LINK]

Cites user3202390 · 2022-12 · Blender Stack Exchange · on “index of CSV file seems to be treating 10s as the same”

I am working through this very helpful tutorial " Data Visualization in Blender and Python [this video] ", but have hit a snag. I'm using this dummy CSV file: width,5 width,10 width,2 width,6 width,10 width,9 width,1 width,10 width,7 width,8 and this version of the YouTuber's code import csv import bpy with open ('/Users/me/Desktop/widthCSV5 - Sheet1.csv', newline='') as f: readout = list(csv.reader(f)) for a in readout: placement = readout.index(a) print(placement) I get this output: 0 1 2 3 1 5 6 1 8 9 The entries that had 10 as a value all get 1 as the index. Has anyone run into this issue before? Thank you in advance!