0
$\begingroup$

I'm trying to learn animation using Animation Nodes, and so far, I've achieved the result in the gif below:

enter image description here

Explanation: If the value of the current frame is less than (B), switch the material from RED to GREEN.

enter image description here

So, I created this setup for 4 objects (S-O-N-G), each with its set of nodes:

enter image description here

My question is: How to simplify this node tree using a list? In other words, instead of repeating the nodes 4 times, I want to streamline it into a single setup using a list.

The relationship of the lists is this:

enter image description here

How can I achieve this? I've been trying to learn from tutorials, but I've spent hours searching and still haven't figured out how to do it in my case.

Thank you.

$\endgroup$

1 Answer 1

0
$\begingroup$

OK, I racked my brain, but I managed to find a solution!

  1. I create a Loop Input node with two new Iterators: Object List and Integer List.
  2. I connect the Iterators to my old setup where I would like to have the variables (in the image below, inside the white frame).

enter image description here

  1. I list my objects by creating the Collection Info node (I placed all my objects inside a collection in the Outliner).
  2. I list the numbers corresponding to the frames by creating the Integer List node.
  3. I create an Invoke Subprogram node.
  4. I connect the two lists (Objects + Numbers/Frames) to the Object List and Integer List inputs of the Invoke Subprogram.

enter image description here

Voila! :D

$\endgroup$

You must log in to answer this question.

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