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

In this Adobe After Effects tutorial, we look at home to achieve diverse animation using the loop expression . This llows you to seamlessly repeat keyframe animations by utilizing properties like loopOut and loopIn

November 26, 2024
How To Use The Loop Expression In After Effects + 4 Variations
Video Editing On Steroids!
ULTIMATE Tools for creating high-quality video content
15M+ Assets
for After Effects, Premiere Pro, FCPX & DaVinci!

Adobe After Effects Loop Expression AKA The After Effects Repeat Expression

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. This is particularly helpful for time-saving and ensuring seamless loops in your animation.

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.

Cycle Loop

loopOut("cycle");

Pingpong Loop

loopOut("pingpong");

Offset Loop

loopOut("offset");

Continue Loop

loopOut("continue");

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.

Examples of Loop Expressions

  1. Cycle Loop (Default Behavior)
    Repeats the animation from start to end in a continuous loop:
    • loopOut("cycle");
  2. Ping-Pong Loop
    Plays the animation forward, then backward, repeatedly:
    • loopOut("pingpong");
  3. Offset Loop
    Each loop iteration adds to the previous cycle, creating a cumulative effect:
    • loopOut("offset");
  4. Continue Loop
    Extends the animation naturally based on the trajectory of the last keyframe:
    • loopOut("continue");