Highlighted

Tips & Tricks for looping keyframes with expressions in After Effects

Adobe Employee ,
Jun 24, 2020

Copy link to clipboard

Copied

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!

TOPICS
FAQ, How to

Views

805

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Tips & Tricks for looping keyframes with expressions in After Effects

Adobe Employee ,
Jun 24, 2020

Copy link to clipboard

Copied

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!

TOPICS
FAQ, How to

Views

806

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 24, 2020 3
Adobe Community Professional ,
Jul 06, 2020

Copy link to clipboard

Copied

Little extra tip:

If you own iExpressions, you can create these loops without writing any expression code yourself.

The Loop iExpression offers all the features of the loopIn and loopOut expression plus some very handy extra features like looping both in and out simultaneously and to auto-smooth loops.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 06, 2020 1
Adobe Employee ,
Jul 09, 2020

Copy link to clipboard

Copied

Nice addition, Mathias! Thanks for the bonus. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 09, 2020 1
Community Beginner ,
Jul 12, 2020

Copy link to clipboard

Copied

That's cool. Here is the way that i usually do, you can check on it:

sportnews24h_0-1594617265798.jpeg

You mographers probably use a simple loop expression, “loopOut()”. And I think once you’ve thought that you wanted to loop only specific keyframes like an image above. It’s easy to do with expression!

[Expression]

1
loopOut("cycle", 2);

 

[Quick Explanation]

1
loopOut(type="cycle", numKeyframes=0);

loopOut() has 2 arguments, loop type and number of keyframes. The number of keyframes is keyframe segments to loop. If you use “loopOut(“cycle”, 1)”, it loops the segment bounded by the last keyframe and second to last keyframe.

I learn this from beatgram. It's while useful.

 

Best regards,

ThaiSon

 

 

Thethao24h

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2020 3