There are a handful of ways to make an animation repeat itself infinitely within Adobe After Effects, but arguably the simplest and most universally effective of them is the Loop Expression. Let’s take a look at how to apply it.
Step 1: The Expression
The Loop Expression has a simple structure, with two variations: Cycle and PingPong.
Cycle (Default):
LoopOut(“Cycle”);
This expression will create a standard infinite loop from the start to end of an animation, as indicated by “Cycle.” The red ghost keyframes are shown to indicate what this animation would look like done manually.
Cycle Mode is the default Loop mode, so you can actually achieve the same effect with:
LoopOut();
PingPong:
LoopOut(“PingPong”);
The PingPong variation of the Loop expression will create an infinite loop, only instead of cycling the animation over and over, it will animate forward, then in reverse, then forward again, and so on.
Step 2: Application
Applying to a Property:
The Loop Expression is applied to the expression feature of a layer’s property. For instance, if you wanted a layer to grow and shrink infinitely, you would keyframe a layer’s scale property appropriately, then apply the Loop Expression to it by alt-clicking the keyframe button.
Applying to Entire Layer:
If you would like to loop a layer in its entirety, even imported footage, you can do so by applying the Loop Expression of your choosing to the Time Remapping feature of the layer. Simply right-click the desired layer, select Enable Time Remapping, then apply the loop expression to the layer.
If this generates a blank frame at the loop point of your layer (a common problem), you can fix it fairly easily; Create a new keyframe at the last frame of your layer, one frame prior to the keyframe that Time Remapping created. Copy your new keyframe and paste it over the keyframe that Time Remapping created, so that there are two of the same keyframe ending the layer’s Time Remapping.
If you want to make the Loop Expression even more convenient, you can try The LoopMaker, a free script by Lloyd Alvarez that allows you to apply custom loops to multiple layers simultaneously with just a few clicks.
Say goodbye to copying and pasting keyframes, and say hello to the time you’ll save with the Loop Expression!