Check out the new audio content!
By using the loop expression, you can create an endlessly repeating animation in a breeze. For example, use the loop expression on a walk cycle, to easily repeat a leg movement.
LoopOut() will play the keyframes back in a cycle loop until the end of the timeline, starting with the last keyframe in the set.
ALT+click the stopwatch of a property to add the expression. Write loopOut() in the expressions field and click somewhere outside of the field to close the expression or hit Enter on your numPad/extended keyboard.
You don’t need to write anything in the brackets. The default loop type is cycle, which means the first and last keyframes need to match for the loop to look seemless.
By using the pingpong loop type, you can quickly loop an animation with a minimum of two keyframes.
If nothing is changed inside the brackets of the function, cycle is the default loop type. But there are other types of loops that change how the loop function behaves.
The pingpong loop type plays the animation from the first to the last keyframe. When it reaches the last keyframe, it plays the keyframe set backwards until it reaches the first keyframe again, starts the process over and continues this until the end of the timeline. Add type = “pingpong” inside brackets of the loopOut() expression.
Loop a Set
By adding numKeyframes to the function, you can define how many sets of keyframes will be looped.
If you have a set of keyframes on a property but you only want to loop the last few, there is an option for that with numKeyframes.
By assiging a value to numKeyframes, no matter how many keyframes are on the property, only that number of keyframe sets will be looped after the playhead has passed the last keyframe. The value 1 for numKeyframes refers to a set of two keyframes.
Add a comma after your loop type and write numKeyframes = value. Replace the word value with the number of your choice.
By limiting the value of numKeyframes to e.g. 1, no matter how many keyframes are on the property, only the last of two keyframes will be looped at the end of the set.
NumKeyframes is a great addition to animation where looping and non-looping keyframes are required. The
first sets of keyframes can perform a unique animation, while the last denominated set can act as looped idle animation.
Any expression can be copied and pasted onto another property even if this property is on another layer.
Right click the property and choose Copy Expression Only. Highlight another layer and hit CTRL+V to paste the expression to the layer.
The expression is automatically pasted to the same property it was copied from.
If you want to paste the expression to a different property on another layer, make sure to highlight that layer’s property first.
If you copied an expression from a Separated Dimension, make sure to perform this step first, before pasting the expression.
Want to Master Expressions?
Join my Motion Graphics Template Course. Enrol Today!
Personalise branded graphics for your YouTube or talking heads video. Learn new and advanced expressions and create responsive, modular templates.