5 Unique Expressions in After Effects

1. Loop Offset

Expression: loopOut(“offset”); or loopIn(“Offset”);
The loop expression in After Effects may already be familiar to you, but you may not be acquainted with the more particular expression of Offset Loop. In brief, keyframe values continue beyond the last keyframe, the Loop Offset expression. Check out the team’s loop expression tutorial here at School of Motion if you want more explanation.
By generating velocity sliders on the fly, one of the very distinctive and exciting ways you can use the loop expression. For example, you could add the loop expression to two keyframes and adjust the keyframe distance to perfect the movement if you wanted a shape to move across your composition at a steady rate.
It’s a fantastic way to quickly adjust repetitive movements.

2. Index

Expression: index;

The index expression is not rocket science, but in After Effects it is an extremely strong instrument. The index expression essentially returns a value depending on the timeline position of the layers. The 4th layer in a timeline, for instance, returns a value of 4.

The index expression’s true power arises by using it as a manner of offset values. Whether you link it to a random seed or use it as a manner to offset a shape layer’s position, there are many possible ways to use this expression.


3. Linear

Expression: linear(inputvalue,InputValueLow,InputValueHigh,OutputLow,OutputHigh);
Example: linear(thisComp.layer(“AudioLayer”).effect(“Both Channels”)(“Slider”),0,20,700,200);.
The linear expression is magic. The linear expression essentially gives you the ability to input a value string (numbers) and output a new value string based on a new proportion. The magic is the linear expression. The linear expression essentially provides you the capacity to input a value string (numbers) and output a fresh value string based on a fresh ratio. Confused?
Obviously you couldn’t just pick up that slider with your shape scale because that would give anyone using your template the capacity to change the layer scale from 0 to 100. Instead, the linear expression could be used to set the proportional yield values to map 0 to 5 and 100 to 20. The remainder of the math will be done after Effects.

4. Clamp

Expression: clamp(input,minimum,maximum)
Example: clamp(thisComp.layer(“Layer 1”).effect(“Slider Control”)(“Slider”),852,1700);
The expression of the clamp can be considered as a manner of creating a ceiling for future layer values. You can tell any property using the expression clamp that it can’t go below a minimum value and that it can’t go above a maximum value. This is super useful when creating projects that will be used as templates by non-designers.

5. ValueAtTime

Expression: valueAtTime(value);
Example: thisComp.layer(index-1).content(“Polystar 1”).content(“Polystar Path 1”).outerRadius.valueAtTime(time-.5);
The expression valueAtTime returns another layer’s value at a particular moment. Think of it as pick-whipping at a very particular time in the timeline to the value of another piece. This can, of course, be very useful in a lot of different ways, but the way in which I’ve found this to be super useful is through using it as a way to offset animations.
To use the expression all you need to do is call the layer property you are attempting to reference and add.valueAtTime(x) where X is the specific time you want the value to be taken from. If you use the expression ‘ time’ instead of a specific number, the values from the property from which the value is taken will basically mirror.
Hopefully, something fresh you’ve learned. If you haven’t seen our 101 tutorial for After Effects Expressions go check it out. You’re going to be better at expressions with a little practice than Vladimir Putin is at creating pets from balloons.

One reply on “5 Unique Expressions in After Effects

Leave a Reply

Your email address will not be published. Required fields are marked *