ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Time remap keyframes loop, then continue

FAQ   •   VIEW ALL
 Time remap keyframes loop, then continue on Sep 20, 2019 at 8:17:45 am

Hi!

This might sound weird but I'll do my best to describe what I'm after.

So, let's say I have a precomp which has many layers with keyframes in them (like a walk cycle of a character). That walk cycle would only have keyframes for one cycle which I could easily loop with time remapping in the master comp.

If in the walk cycle precomp I have animated the character to stop after that one cycle, is it possible to loop the walk cycle in the master comp for 10 times and then jump to the point where he stops?

I'm asking this because I'd like to have only the essential movement of the character in the precomp and do the looping stuff with an expression.

Let's say the walk cycle starts at 0 seconds in the precomp and the stopping animation starts at 2 seconds. (this is made up, the point is to give some reference for the times).

 Re: Time remap keyframes loop, then continueon Sep 20, 2019 at 10:27:51 am

Try this

```dur = 1.5; //Duration of the cycle cycles = 5; //Cycles, obviously :D (time-inPoint < cycles*dur) ? (time-inPoint)%dur : (time-inPoint)-(cycles-1)*dur```

Andrei
My Envato portfolio.

 Re: Time remap keyframes loop, then continueon Sep 23, 2019 at 6:28:02 am

Thanks, that works like a charm! Will be very useful.

How about if there's more than two different actions in the precomp? Like if theres the walk cycle, the character stop and lets say... some dancing and then waving hand? Is there a way to jump between different times in the precomp and loop them?

 Re: Time remap keyframes loop, then continueon Sep 23, 2019 at 8:41:36 am

It is possible but it is exponentially more difficult.
You need to create some arrays of intervals and see in which interval the time fits.
Then you need to see which time from the precomp you need to use in the given interval.

Andrei
My Envato portfolio.