How to Loop in After Effects - Loop Keyframes & Compositon

Looping in After Effects is achieved through the use of expressions, specifically the loopOut expression, applied to the Time Remapping property of a pre-composed layer or directly to an animated property. This technique allows for seamless repetition of sequences, animations, or video clips, enhancing the dynamics of a project and improving workflow efficiency.

October 29, 2023
How to Loop in After Effects - Loop Keyframes & Compositon
"Video editors relying on templates lack genuine skill and creativity."

What do you think? Submit your opinion to see what others have to say!

"It's Like Video Editing On Steroids!"
- Sebastian Navarro, FreeVisuals Editor
Endorsed by Adobe, Motion Array is the ULTIMATE tool for creating high-quality videos! Browse 15M+ assets for Premiere Pro, After Effects, FCPX & DaVinci!

Adobe After Effects Loop Video

Looping in After Effects (AE) is a fundamental skill that every video editor should have under their belt. It's a technique that allows you to repeat a sequence, animation, or video clip seamlessly, creating a continuous cycle. This can be particularly useful in creating animated backgrounds, GIFs, or any repetitive motion. Let's dive into the details.

Step Procedure Pro Tips
1 Select the layers you want to loop, right-click, and choose Pre-compose. Organize your layers properly before pre-composing to avoid confusion.
2 With your new composition selected, go to the "Layer" menu, then "Time", and click on "Enable Time Remapping". Time Remapping allows you to control the timing of your composition.
3 In the timeline, Alt + Click (or Option + Click on a Mac) on the stopwatch next to the Time Remapping to enable expressions. In the expression field that appears, type `loopOut(type="cycle", numKeyframes = 0)`. The "cycle" type repeats the segment bounded by the two keyframes. Other types include "continue" and "pingpong".
4 Create your animation by setting keyframes for the property you want to animate. Ensure your keyframes are properly set to achieve the desired animation.
5 Just like before, Alt + Click (or Option + Click on a Mac) on the stopwatch next to the property to enable expressions. In the expression field, type `loopOut(type="cycle", numKeyframes = 0)`. The `numKeyframes` parameter in the expression determines how many keyframes the loop includes. If you set it to 0, it will include all keyframes; otherwise, it will include the specified number of keyframes.

Understanding Looping

Looping, in essence, is the process of repeating a sequence or animation over and over again. In After Effects, this is achieved through expressions, a type of scripting language that allows you to create relationships between layer properties or keyframes so the designer can animate layers without defining each keyframe by hand.

Looping a Composition

To loop a composition, you'd typically pre-compose the layers you want to loop, then apply the loop expression to the Time Remapping property of the pre-composed layer. Here's how you can do it:

  1. Pre-compose Your Layers: Select the layers you want to loop, right-click, and choose Pre-compose. This will create a new composition with your selected layers.
  2. Enable Time Remapping: With your new composition selected, go to the "Layer" menu, then "Time", and click on "Enable Time Remapping". This will allow you to control the timing of your composition.
  3. Apply the Loop Expression: In the timeline, Alt + Click (or Option + Click on a Mac) on the stopwatch next to the Time Remapping to enable expressions. In the expression field that appears, type loopOut(type="cycle", numKeyframes = 0). This expression tells AE to loop the composition.

By the way, the loopOut expression has different types you can use. The "cycle" type, which we used above, repeats the segment bounded by the two keyframes. Other types include "continue", which extrapolates the curve beyond the last keyframe, and "pingpong", which alternates the playback direction between keyframes.

Looping Keyframes

Looping keyframes might be a bit more complex, but it's worth the effort. For instance, if you have an animation that you want to repeat, you can apply the loop expression to the property you've animated. Here's how:

  1. Animate Your Property: Create your animation by setting keyframes for the property you want to animate.
  2. Apply the Loop Expression: Just like before, Alt + Click (or Option + Click on a Mac) on the stopwatch next to the property to enable expressions. In the expression field, type loopOut(type="cycle", numKeyframes = 0).

In my opinion, it's important to note that the numKeyframes parameter in the expression determines how many keyframes the loop includes. If you set it to 0, it will include all keyframes; otherwise, it will include the specified number of keyframes.

Conclusion

All things considered, looping in After Effects is a powerful tool that can save you time and add interesting dynamics to your projects. It might seem a bit intimidating at first, especially if you're not familiar with expressions, but once you get the hang of it, you'll find it's a game-changer. As far as I know, the more you practice, the more comfortable you'll become with using expressions and the more efficient your workflow will be. So, how about giving it a try on your next project?