3
$\begingroup$

I'm rather new to blender but would like to try to animate flows (in my case movements of animals between herds) using data in a csv file with the following structure:

movement#,Start_time,Origin_x, Origin_y, Destination_x, Destination_y

I've seen an excellent answer (here) with animation nodes to animate objects, but in the example, the location was available for each time step. Wouldn't be possible to do this with keyframes linked to location? The minimum "start_time" of the file could be set to 1 and the end keyframe could be a fixed value added to that or a calculated distance adjusted value in another column in the csv.

I've tried my best to develop it from the other example I mentioned, but I'm probably too "Green" on blender to make it work. The goal is to animate several hundreds of movements using light streaks, but I'll get to that once (if) I manage to do the basics. Any help would be appreciated!

$\endgroup$
2
$\begingroup$

You create a loop and parse all the numbers, create an origin vector and a destination vector. Then in another loop, you use an Animate Vector Node to animate between both vectors, you subtract the parsed starting frame from the time and set the duration to the parsed duration. Use the output vector list to locate your objects and you are done. You can also cache the parsed loop for a performance boost.

Node Tree

Now animate and you will see the animation:

Result

If you have an animal and you want to instance it and locate the instances, you could use the Object instancer node:

Result 2

There is of course more to this, but it may be complicated for you at this stage.

Here is the file:

$\endgroup$
  • $\begingroup$ Thank you @OmarAhamad! From the example I get an idea how it works. I've managed to reproduce your example until the last "Vector list" node, that I'm probably too green in blender to add it. Must objects be manually created (1 per movement) or are (can) they be created from the list? Is there any chance you could share the blender file? Sorry for my ignorance, but visualization is just more like a hobby to me (if that is an excuse). $\endgroup$ – Tnunes Aug 7 '17 at 15:51
  • $\begingroup$ @Tnunes I edited the answer. $\endgroup$ – Omar Emara Aug 7 '17 at 17:12
  • $\begingroup$ GREAT! Exactly what I was looking for. I'll start from there and see where I can get. $\endgroup$ – Tnunes Aug 7 '17 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.