• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
18

Tips & Tricks for looping keyframes with expressions in After Effects

Adobe Employee ,
Jun 24, 2020 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

55.3K

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
community guidelines
Community Expert ,
Jul 06, 2020 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.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

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
community guidelines
Adobe Employee ,
Jul 09, 2020 Jul 09, 2020

Copy link to clipboard

Copied

Nice addition, Mathias! Thanks for the bonus. 

Votes

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
community guidelines
Community Beginner ,
Jul 12, 2020 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

Votes

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
community guidelines
Contributor ,
May 30, 2023 May 30, 2023

Copy link to clipboard

Copied

Thanks for sharing!! Reading this in 2023 and it's the clearest explanation of how "cycle" works with keyframe "segments." Extremely helpful!

Votes

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
community guidelines
New Here ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

LATEST

Thanks!!! very usefull tip

 

Votes

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
community guidelines
Community Expert ,
Nov 29, 2021 Nov 29, 2021

Copy link to clipboard

Copied

Excelente aporte!
saludos

Harold Silva B.

Votes

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
community guidelines
New Here ,
Feb 17, 2022 Feb 17, 2022

Copy link to clipboard

Copied

Thanks for sharing. It was quite informative.

Votes

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
community guidelines
New Here ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

Thanks for sharing

Votes

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
community guidelines
New Here ,
Apr 04, 2022 Apr 04, 2022

Copy link to clipboard

Copied

Thank you for the info! My question would be, what if you turned the animation into a mogrt to use in premiere? If you added protected regions to the Ae comp and extend the layer on the Premiere timeline, would the infinite loop animation continue to play or just end at the original Ae comp timecode? 

Votes

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
community guidelines
Community Beginner ,
Jun 21, 2022 Jun 21, 2022

Copy link to clipboard

Copied

I've actually made a really simple panel you can use to automatically add loop expressions (including to shape layers).  I do a lot of looping and I've found it a real time-saver!
You can download it (free) from:

https://frankmansfield.co.uk/stuff/loop.php

Give me a shout with any questions  🙂

Cheers
-f

Votes

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
community guidelines
Community Expert ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

Amazing! Thanks.

Votes

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
community guidelines
Community Beginner ,
Oct 12, 2022 Oct 12, 2022

Copy link to clipboard

Copied

My absolute pleasure - hope it helps my fellow loopers!  🙂

Votes

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
community guidelines
Enthusiast ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Basically the same information but with helpful animations!

 

https://www.schoolofmotion.com/blog/loop-expression-after-effects

Votes

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
community guidelines
New Here ,
Nov 30, 2022 Nov 30, 2022

Copy link to clipboard

Copied

Much thanks to you for the data! My inquiry could be, imagine a scenario where you transformed the liveliness into a mogrt to use in debut. Assuming you added safeguarded locales to the Ae comp and expand the layer on the Debut timetable, could the boundless circle movement keep on playing or simply end at the first Ae comp timecode?

Votes

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
community guidelines