After Effect Expression For Looping In and Out - How To Use It

In After Effects, utilize the loop expression to seamlessly repeat keyframes, with properties like loopOut() for looping beyond the last keyframe and loopIn() for before the first. Different loop types, such as CYCLE, PINGPONG, OFFSET, and CONTINUE, offer varied looping behaviors, enhancing your animation's dynamics.

October 29, 2023
After Effect Expression For Looping In and Out - How To Use It
"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!

Loop In and Out After Effects Expression ()

Loop Expressions in After Effects

CYCLE Loop

loopOut(); or loopOut("cycle");

Repeats your keyframes indefinitely. Once it reaches the last keyframe, it jumps back to the first.

PINGPONG Loop

loopOut("pingpong");

Goes back and forth between your first and last keyframe.

OFFSET Loop

loopOut("offset");

Builds on itself by adding or subtracting the ending value from the starting value.

CONTINUE Loop

loopOut("continue");

Continues the speed/value of the final keyframe.

What is the Loop Expression in After Effects?

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's a versatile tool that can be used in various scenarios like walk cycles, logo reveals, and background designs.

How to Use the Loop Expression:

  1. Accessing the Expression Field: To start, you'll need to hold the 'Alt' key and click on the stopwatch icon next to the parameter with keyframes. This will open the expression field.
  2. Types of Loop Properties: There are two main properties you should be familiar with:
  3. loopOut(): This loops beyond the last keyframe.
  4. loopIn(): This loops before the first keyframe.
  5. For most projects, you'll likely use the loopOut property.
  6. Loop Types: There are different types of loops, and each has its unique behavior:
  7. CYCLE: This simply repeats your keyframes indefinitely. For instance, once it reaches the last keyframe, it jumps back to the first.
  8. PINGPONG: As the name suggests, this type goes back and forth between your first and last keyframe.
  9. OFFSET: This type builds on itself by adding or subtracting the ending value from the starting value, creating a continuous movement.
  10. CONTINUE: This type continues the speed/value of the final keyframe. So, if your animation ends with a certain speed, that speed would persist beyond the final keyframe.
  11. Argument Modifier: This is an advanced feature that tells After Effects which keyframes you want to loop. For instance, if you have 5 keyframes, you can instruct After Effects to loop only the last 2. This is achieved by adding a comma and a number to your loop expression.

Visualizing the Loop: You can see a visual representation of the loop's motion in the graph editor by selecting the small graph button next to the expression window.

Practical Application:To use the "Loop Out" function in After Effects:

  • Select the layer or keyframes you wish to loop.
  • Right-click on your selection and choose "Keyframe Assistant" from the dropdown.
  • From the submenu, select either "Loop Out" or "Loop Out (Ping-Pong)" based on your desired looping style. After Effects will then automatically create additional keyframes to form a seamless loop.