Page 1 of 1

How to create complex looping animation

Posted: Thu Aug 10, 2017 8:36 pm
by Víctor Paredes
Hi, this is something I wanted to share here for a long time and maybe can help you:

For having complex scenes with different duration cycles and make them all coincide in the loop, I always use relative cycles and this simple rule:
2x+1
Where x is the previous smaller cycle.

So, for instance, if your smaller cycle goes back only 1 frame, the next cycle will need to go back 2*1+1, which is 3 frames.

Since this new cycle goes back 3 frames, the next one should go back 2*3+1 frames, which is 7.
Image

The next one should be 2*7+1=15, and so on.

If you continue applying this method, you will get this:

1
3
7
15
31
63
127
255
etc.

All that numbers are the cycles you can use. Any other number you use, will break the cycle.
Now, to render the animation with the cycle working, you need to have an animation as long as your longer cycle and add two more frames to it.
So, if my longer cycle goes back to 255, then my final animation needs to be 257 frames.
When my animation is 257, then I'm sure that every single cycle will loop seamlessly.

Image
Image

And finally. With the current setup, all cycles will coincide at certain point and sometimes that can look unnatural. That's why I prefer to use relative cycles. Once I know the numbers I can use for my cycles, I can move the relative cycles in the timeline, making them loop at totally different moments.

Image
If you move the cycles in timeline, then your animation will need to start at a frame different than zero (to be sure all the cycles have started) or group everything and move the group to the left in the Sequencer.

Ok, I know this is very technical, but I prefer to post it, because -at least for me- it's extremely useful.

Re: How to create complex looping animation

Posted: Wed Aug 16, 2017 12:11 pm
by jezjones29
Thanks Víctor. This is very handy when creating gifs!
I've created a quick tool that uses this method to work out the next numbers: https://www.animestudiotutor.com/loopcalc

It may be worth pointing out that the final exported animation is the longest length - 1
So in your above 257 frame example, it would be 256 exported frames.

Re: How to create complex looping animation

Posted: Wed Aug 16, 2017 2:21 pm
by jahnocli
Of course, Victor, you know that all the cycle numbers in your list are powers of 2 -1? (I feel like I'm stating the obvious here, but as no-one else has mentioned it...)

Re: How to create complex looping animation

Posted: Wed Aug 16, 2017 4:41 pm
by hayasidist
jahnocli wrote:Of course, Victor, you know that all the cycle numbers in your list are powers of 2 -1? (I feel like I'm stating the obvious here, but as no-one else has mentioned it...)
unless you start with a cycle of 5...

the general formula for this using powers of 2 is 2^(n-1) * (smallest+1) - 1 (which, when smallest is 1, does become 2^n - 1)

Re: How to create complex looping animation

Posted: Mon Aug 21, 2017 3:14 pm
by Víctor Paredes
jahnocli wrote:Of course, Victor, you know that all the cycle numbers in your list are powers of 2 -1? (I feel like I'm stating the obvious here, but as no-one else has mentioned it...)
Not really, thank you for pointing it. Mathematics knowledge is one of my weaknesses (and I'm always trying to overcome that bad foundation).
jezjones29 wrote:Thanks Víctor. This is very handy when creating gifs!
I've created a quick tool that uses this method to work out the next numbers: https://www.animestudiotutor.com/loopcalc
It may be worth pointing out that the final exported animation is the longest length - 1
So in your above 257 frame example, it would be 256 exported frames.
Fantastic! Thank you very much, Jez.