How to create complex looping animation

Have you come up with a good Moho trick? Need help solving an animation problem? Come on in.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

How to create complex looping animation

Post 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.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
jezjones29
Posts: 339
Joined: Tue Jan 31, 2006 9:43 pm
Location: Wales, UK
Contact:

Re: How to create complex looping animation

Post 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.
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: How to create complex looping animation

Post 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...)
You can't have everything. Where would you put it?
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: How to create complex looping animation

Post 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)
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: How to create complex looping animation

Post 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.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
Post Reply