Question
Tips & Tricks for looping keyframes with expressions in After Effects
Instead of copy-pasting your keyframes through the whole composition, use expressions to loop your animations!
Here's the walkthrough. After you've keyframed one loop of your animation...
- Alt + click (PC) or Option + click (MAC) the stopwatch next to the parameter you want to loop – scale, position, rotation, etc.
- Delete the code that displays in the expressions editor
- Replace it with one of the following expressions
- loopIn("cycle") will repeat your animation before the keyframes in your timeline. The animation will end at the last keyframe.
- loopOut("cycle") will repeat your animation after the keyframes in your timeline. The animation will end with your composition.
- loopOut("continue") will take the last two keyframes of your animation, and continue that stroke indefinitely.
- loopOut("pingpong") will carry your animation forwards and backward through the keyframed positions.
- loopOut("offset") will bring the entire animation along. The animation will repeat itself starting from the last keyframed point.
Note: the default loop effect is set to "cycle" and can be left out of the expression for convenience.
- loopIn() and loopOut() will produce the same animation as loopIn("cycle") or loopOut("cycle")
Hope this helps!

