Create an expression that does nothing.
Ok, maybe not the most exciting tutorial, but it gives me a chance to explain a
few expression fundamentals.
Create a new solid and press "p" to view its position property.
Add a few position keyframes along the Timeline to make the layer move around
the comp window.
Now add an expression to the position property. You can do this either by selecting
the position name and choosing Animation > Add Expression from the main menu,
or much easier, just option-click on the stopwatch icon beside the property.
The default expression will be:
If you preview through the Timeline, you'll see the layer is moving in exactly the
same way as before you applied the expression. You have successfully created an
expression that does nothing!
NOTE: Basically, the default expression on any property will always produce
a result that is the same as if there was no expression applied.
The word position is used by After Effects to represent the position value for the
layer containing the expression. The expression is setting the layer's current
position to the layer's current position value, so nothing changes.
In the last tutorial, the expression was essentially telling position what it's value
should be. Make the value of this property (which was position) equal [160,120]
In this example, the expression is asking for the property's current value by using
the word position (which represents the current position value). Because this is
the last line of the expression, it also becomes the result of the expression.
So the expression position is asking for the layer's current position value, then
telling it to set the current position value to that same value. Kind of like saying:
currentPosition = position;
position = currentPosition;
Something else to understand about expressions, is that they are recalculated
on every frame.
Although the expression in the last tutorial [160,120] is recalculated on every
frame, the result is always the same, so the layer remains fixed to a spot.
But in this example, because the expression is setting the position to whatever
its current position value is on any given frame (in this case they are keyframed
values), the result is that the layer continues to move around in exactly the
same way as it did without the expression.
Admittedly, on its own this expression is completely useless. This is just to
introduce you to the concept of using words like position, opacity, rotation,
etc to read a layer's current values.