3

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!

Tnunes
  • 33
  • 3

1 Answers1

2

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:

Omar Emara
  • 22,639
  • 5
  • 55
  • 103
  • 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). – Tnunes Aug 07 '17 at 15:51
  • @Tnunes I edited the answer. – Omar Emara Aug 07 '17 at 17:12
  • GREAT! Exactly what I was looking for. I'll start from there and see where I can get. – Tnunes Aug 07 '17 at 23:54