Blender for Scientists - Importing Data Directly to Geometry Nodes

preview_player
Показать описание
This is a walkthrough for importing and using CSV data directly in geometry nodes in Blender. It covers both 3D mesh data (which would work for topography scans as well) and also shows how to import and setup graph data for animations.

0:00 Intro
0:30 Add-on download and installation
1:45 Mesh Data
2:50 Importing the example Data
4:15 Data Setup in Geometry Nodes
5:12 Simple Data Separation Example
6:30 Working with Instances and Shaders
8:30 Shader Setup
11:15 A Note about Importing Large Datasets
12:20 Importing Simple Graph Data
13:33 Geometry nodes setup for curves
16:40 Differences in Blender 3.4 and onward
17:20 Scaling graph axes and curve to mesh
18:45 Simple curve tools for animation
19:30 Shading setup for selecting specific graph regions
22:08 Wrapping Up

Community Discord:

The CGFigures Asset Library:
A compilation of most of what I've released/will release in one CC0 package:

For more CGFigures content checkout the links below:
Рекомендации по теме
Комментарии
Автор

Since Blender 3.1, it can be useful to render the data points as a point cloud, without instancing. Cycles renders them as spheres, and I've found it to be considerably faster. This also skips the need to realize instances.

Instead of using the "Attribute statistic" node, the "Domain size" node can be used to get the max index more directly.

I wonder why the addon imports the data points as a mesh, instead of a (presumably lighter) point cloud. Maybe for retro-compatibility or some edge use cases.

MrTomyCJ
Автор

Great to see someone taking on the area of data visualisation in blender. I'd love to know how to import rolling time series data in chunks, rather than importing all data in one go.

jgdublin
Автор

This is wonderful, thank you! I wrote a script to import coordinate data from a csv file into blender, but the ability to store and use attributes makes this add-on so much better! Thank you for spending the time to share this in such a clear way.

jonwoods
Автор

This video was exactly what I was looking for - I've been searching for a way to import XYZ points with attributes into blender for use with geometry nodes - thank you!

CharlesParkinson
Автор

amazing video thank you, no wonder i've had notifications turned on for your channel

chicao.do.blender
Автор

wow, I'm not a scientist but I like how you explain GN and the shaders, Thanks 🙏

HaniTiby
Автор

Great video! Thankfully 3.4 onwards you can set colours per instance without having to realize them first

BradyJohnston
Автор

Maybe this is useful for other people: I just fiddled around with chatGPT to write a script that does the same thing as the plugin but automatically imports all available columns so you don´t have to define each field manually on import like with the plugin. My csv has many columns, so this saves a lot of time on setting up the import. Replace "openai_test.csv" (tested on Blender 3.4)
(I cannot code myself but it works and seems to use a lot less code than the plugin, chatGPT is spooky af)
---
import bpy
import csv
import os

# Get the path to the CSV file in the same directory as the Blender file
blend_file_path = bpy.data.filepath
directory =
csv_file_path = os.path.join(directory, "openai_test.csv")

# Create a new mesh object
mesh =
obj = bpy.data.objects.new("CSV_Object", mesh)

# Link the object to the current collection


# Set the object as the active object
= obj
obj.select_set(True)

# Load the CSV data
with open(csv_file_path, newline='') as csvfile:
reader = csv.reader(csvfile)
header = next(reader) # Get the header row

# Create an empty list for each column
columns = {name: [] for name in header}

# Fill the lists with the data from the CSV file
for row in reader:
for i, value in enumerate(row):
if value.strip() else 0.0)

# Calculate the number of points needed for the mesh
num_points =

# Set the total number of vertices in the mesh


# Set the vertices location to ensure they are displayed
for i in range(num_points):
mesh.vertices[i].co = (0, 0, 0)

mesh.update()

# Add the data to the object data properties as custom attributes
for name, values in columns.items():
# Create a new custom attribute with the name derived from the CSV
prop = obj.data.attributes.new(name, "FLOAT", domain="POINT")

# Set the attribute values
prop_data = prop.data
for i, value in enumerate(values):
prop_data[i].value = value

print("CSV data imported successfully")
---

fredarthur-art
Автор

Thank you very much for this wonderful tutorial!!!

patriciabondia
Автор

I love your channel so much! Thank you, it's such amazing content.

kettospontde
Автор

Thanks you so much for this tutorial!!!

LauertdasVerderben
Автор

if you find a hole in your precious timetable - blender 4+, ohlc (open high low close) financial data (ie yahoo finance - gold daily), x axis as datetime, y axis as value / price. bar representation wold be just fine, candlestick would probably take way more computer power. thx for sharing, have fun

aumhren
Автор

Thanks for the tutorial. Is there a way to reload update a CSV without creating a new object and having to re-apply all the nodes? There is a hint about updating on the github site but I never got this to work using the "Object Info" node. I just used the name attribute nodes like you did.

fredarthur-art
Автор

I tried to import a csv file made from a midi file.

For me this didn't work. I continue to get the error message that tie columns are not properly formatted, even though I made a new csv file in Excel.

It even failed when I made a file with just four columns and 5 rows in Excel.

After that I just gave up!

So, for me it was a complete waste of my time!

konradswart
Автор

The addon github doc is incomplete, your tutorial just saves my life🥺

CalmDownPanda
Автор

Very useful video. I would love to see an example of where there's a movable point on the graph that reads out the values at that point, would be a nice visual aid during animations where you cant read off the axis as quickly. Speaking of axis, is there a way to add one in?

naveedishtiaque
Автор

is there a way to import coordinate and time data into animation in blender? I have a way to record position and orientation data of, for example, a vehicle up to 40 times per second from a game I play and make it into a .csv file with a couple of button presses and I'd love to turn that data into a blender animation.

outandabout
Автор

Thank you very much for this great overview. Is it possible to create also 3d mesh data for surfaces e.g. to visualize finite element method results?

lucky_EINS
Автор

hi i need more decimal number, minimum 7. Which option change the float number precision ? Thanks

marcoscama
Автор

Thanks for that. I'm trying to find a way to export data from the spreadsheet to a CSV (I use node to generate a random distribution of objects, with specific randomised angle distribution which I want the details of to analyse using R). I'm starting to think this is not possible using Python in blender but may require to mod the Blender source code.
I guess the alternative is to generate the random distribution outside of Blender then use this method to import that data to Blender so I can take photos of it.

Drcraigbarton