Loop In and Out After Effects Expression
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.
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.
How to Use the Loop Expression:
- 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.
- Types of Loop Properties: There are two main properties you should be familiar with:
- loopOut(): This loops beyond the last keyframe.
- loopIn(): This loops before the first keyframe.
- For most projects, you'll likely use the loopOut property.
- Loop Types: There are different types of loops, and each has its unique behavior:
- CYCLE: This simply repeats your keyframes indefinitely. For instance, once it reaches the last keyframe, it jumps back to the first.
- PINGPONG: As the name suggests, this type goes back and forth between your first and last keyframe.
- OFFSET: This type builds on itself by adding or subtracting the ending value from the starting value, creating a continuous movement.
- 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.
- 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.