2
$\begingroup$

Using python, how can I update a text object in a blender animation, every 10 frames, using data from a csv file containing 8million data points?

This question was addressed nicely by alambre using python (as requested). @chris proposed an Animation nodes solution but didn't get the opportunity to elaborate.

I'm curious to know what an animation nodes solution would look like to the same problem. I'd hope to try both solutions and weigh up the pros and cons in the context of my own production workflow. Thanks for reading my question and for your time.

$\endgroup$

1 Answer 1

3
$\begingroup$

node setup:

enter image description here

read data - python script:

import csv

data = []

with open('/Users/chris/downloads/nueva_data.csv') as f:
    reader = csv.reader(f)
    for row in reader:
        data.append(row)
        

result:

enter image description here

Note: i am using a Macbook so your file path string might look different.


Update:

unfortunately with the upper version and with 8 Mio data entries it feels like waiting endless for a result. So this version just reads one time on frame 1:

enter image description here

$\endgroup$
10
  • $\begingroup$ that actually looks not too complicated at all. Does it load in all the data first or does it stream the data from the file as needed? $\endgroup$ Commented Apr 3, 2022 at 11:51
  • $\begingroup$ thanks man, that is quite a simple set up! so to pull in the other data Id just add a get list element for each value that I want to display. $\endgroup$ Commented Apr 3, 2022 at 11:56
  • $\begingroup$ worse - it reads it every frame....we should improve that $\endgroup$
    – Chris
    Commented Apr 3, 2022 at 11:56
  • $\begingroup$ i am working on a better solution...give me some minutes ;) $\endgroup$
    – Chris
    Commented Apr 3, 2022 at 11:59
  • 1
    $\begingroup$ I assumed Animation nodes writes Python behind the curtain. This is very helpful either way, as I plan to add in some updating stats as blender moves through the csv content. Value Frequency, probability vs actual occurrence. Highest values, a rolling median result. I think AN might be useful for that also. $\endgroup$ Commented Apr 5, 2022 at 5:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .