0
$\begingroup$

I created an animation-nodes setup which should take a cube, scale it and translate it by its new dimensions. This step should be repeated so I put it in a loop. I thought when I press "Execute Node Tree" the result I obtain would always be the same; instead it changes; the same problem persists if I decrease the Instances in the Object Instancer.

I do not fully understand why this is and I don't know how to fix this. The behavior I'd like to is that when Instances is for example 4 it should not matter if it was some other number before.

Attached is a screenshot of the setup and the (expected) result of the transformed cube as well as the .blend file.

Any help is greatly appreciated. Best regards

blackno666animation node setup

$\endgroup$
0
$\begingroup$

By reading the transformation values of your instances in the Object Transforms Input node and later setting them on the same instance in the Object Transforms Output node you create a feedback loop. Each time you execute the node tree you modify the object based on the values of the previous iteration and not on some default state. Only when you increase the number of instances you get “fresh” objects, which is why the instances might appear at the desired location at that time.

My suggestion is to not use the instances' Object Transforms Input but rather compute the transformation values some other way. For example by using the Index of the loop. You could also add some other objects' Object Transforms Input, e.g. the location of another cube to influence the offset of your instances. You only have to be careful if you write the transformation values that you're reading.

Edit:
I modified the previous solution to use a transformation matrix instead of a mathematical expression. A combination of a list of matrices or repeated multiplication – as AN's Matrix Math node has no Power built in – allows the recreation of something similar to Structure Synth's iteration function. A more complex node setup would also allow it to pick a different matrix (or a mixture of them) for each iteration at random, resembling the assignment of multiple definitions to the same rule in Structure Synth.
If you want to avoid the matrices you could also try to read the transformation values of an object's predecessor in the object instances list.

transformation matrix solution

$\endgroup$
  • $\begingroup$ This will surely work. However, I don't like the math in it (not because I don't like math, but) because I would like to use random numbers in the transformation and that can't easily be calculated by a fixed formula - more sophisticated scripting would be needed. My original intention was to create objects like they can be created with Structure Synth. Structure Synth basically takes a state and modifies it and uses it as a the new state. $\endgroup$ – blackno666 Feb 9 '17 at 22:54
  • $\begingroup$ @blackno666 I edited the answer to include a solution that doesn't rely on a mathematical expression. I think this approach will make modification or animation easier. $\endgroup$ – binweg Feb 10 '17 at 8:15

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.