I have many lists of rotation matrices for one object. The lists have different lengths. For each list I would like to obtain an animation where the rotations are performed one after the other in the order of the list.

This could be done with a sequence of "animate matrix" nodes where the result of the first node goes into the "start" input of the second node etc. "Delay time nodes" would control the start of rotations.

However, this approach requires that the node tree is changed for each list, depending on the length of the list.

Is there a way to obtain a node tree that works for any length of the list of rotation matrices?

  • $\begingroup$ I'm not too familiar with this workflow, but wouldn't just padding the shorter lists with identity (null rotation) matrices work? $\endgroup$ – Nicola Sap Nov 8 '18 at 15:55
  • $\begingroup$ In principle yes, but with 20 to 50 rotations the node tree would still be quite cumbersome. Some clever kind of loop would be my ideal. $\endgroup$ – Peter Hilgers Nov 8 '18 at 16:16
  • $\begingroup$ Ok I see! I'll let the more experienced in animation-nodes reply :) $\endgroup$ – Nicola Sap Nov 8 '18 at 16:22
  • $\begingroup$ Have a look at this answer. If I understand you correctly, then the answer should be somewhat the same. $\endgroup$ – Omar Emara Nov 8 '18 at 18:10
  • $\begingroup$ @Omar Ahmad: You are absolutely right: I have just to feed the list of rotation matrices into the index computation. Thanks a lot. $\endgroup$ – Peter Hilgers Nov 9 '18 at 11:44

First, we are going to compute what you might call the Accumulated Transformation of each matrix in the list, this accumulated transformation is simply the result of multiplication of all the matrices in the list before that matrix. This is done using this simple loop:

Accumulated Transformation

Notice that the Matrix parameter is initially identity matrix. Then we are going to use the same principle describe in this answer to animate between all the accumulated transformations as follows:

Node Tree

  • $\begingroup$ As I am new to AN could you please explain the setup steps for the loop? $\endgroup$ – Peter Hilgers Nov 9 '18 at 15:46
  • $\begingroup$ @PeterHilgers Perhaps you should read the documentation on loops as it is not trivial. Let me know if you are still having trouble. $\endgroup$ – Omar Emara Nov 9 '18 at 17:09
  • $\begingroup$ Sorry, you are right. $\endgroup$ – Peter Hilgers Nov 9 '18 at 17:43

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.