How To Use The Loop Expression In After Effects + 4 Variations

In After Effects, the loop expression allows you to seamlessly repeat keyframe animations. By utilizing properties like loopOut and loopIn, along with various loop types such as Cycle, Pingpong, Offset, and Continue, you can achieve diverse animation effects tailored to your project's needs.

October 29, 2023
How To Use The Loop Expression In After Effects + 4 Variations
"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 Expression AKA The After Effects Repeat Expression

Loop Expressions in After Effects

Cycle Loop

loopOut("cycle");

Pingpong Loop

loopOut("pingpong");

Offset Loop

loopOut("offset");

Continue Loop

loopOut("continue");

What is the Loop Expression?

The loop expression, as the name suggests, allows you to loop a series of keyframes. But it's not just about cycling between the first and last keyframes. It offers a lot more versatility, making it invaluable for tasks like walk cycles, logo reveals, and background designs.

How to Use the Loop Expression:

  1. Loop Properties: The main properties you'll encounter are loopOut and loopIn.
  2. loopOut(): This loops beyond the last keyframe.
  3. loopIn(): This loops before the first keyframe.For most projects, you'll find yourself using the loopOut property.
  4. Loop Types: There are different types of loops that can modify how your loop functions.
  5. Cycle: This simply repeats your keyframes indefinitely. When it reaches the last keyframe, it jumps back to the first. By default, a loop property without a type defined will be a cycle.
  6. Pingpong: As the name suggests, this type goes back and forth between your first and last keyframe.
  7. Offset: This type builds on itself by adding or subtracting the ending value from the starting value and applying the difference to your final or opening keyframes.
  8. Continue: This type continues the speed/value of the final keyframe. So, if your loop ended with a certain speed, that speed would continue beyond the final keyframe.
  9. Argument Modifier: This is an additional component you can add to your loop expressions. It tells After Effects which keyframes you want to loop. For instance, if you had a sequence with 5 keyframes, you could instruct After Effects to loop only the last 2. This is achieved by adding a comma and a number.

How to Implement the Loop Expression:

  1. Create your keyframes as you would for any standard animation project.
  2. Select the value you want to add an expression to in the Timeline.
  3. Navigate to Animation > Add Expression. Alternatively, hold Alt and click the Stopwatch icon next to the Value.
  4. In the box on the Timeline, type or paste in your desired expression. After Effects will predictively suggest elements for you.
  5. Check your animation and add a modifier if necessary.