- To see it working in action. First create a text layer, and in the source code property type
time ( );and play your animation.
|Expression||Example Speed/sec.||Rotation Property|
|time * 360||Full Rotation|
|time * 360/2||Half a Rotation|
|time * 360/4||Quarter rotation|
|Expression||Example Speed||Position Property|
|transform.position + time *100;||Box A|
|transform.position + time *200;||2x Speed Box A|
|transform.position + time *300;||3x Speed Box A|
|Expression||Example Speed||Scale Property|
|transform.scale + time * 50;||Box A|
|transform.scale + time * 100;||2x Speed Box A|
|transform.scale + time * 200;||3x Speed Box A|
The valueAtTime(t) Expression
Allows multiple animation of objects linked to one another, streamlining the offset values. It can be added to multiple properties such as (Position, Opacity, Rotation etc…)
- Step 1: Create a Main Layer and add key frames for animation
- Step 2: Duplicate the Main layer
- Step 3: Add an expression on the animated property in the Duplicated layer. Then using the pick whip tool, link it to the Main Layer and add the expression
.valueAtTime(time). Offset the animation by adding a subtraction (-) or plus (+) sign after the text “time“and ad a numeric value offset for in seconds.
|Expression||What Does It Mean?|
|valueAtTime (time – 0.25)||Delay by a quarter of a second|
|valueAtTime (time – 0.5)||Delay by half a second|
|valueAtTime (time – 1)||Delay by One second|
|valueAtTime (time + 0.25)||Ahead by quarter of a second|
- Circle 1 has the Y-Axis key frame positions set.
- Then Circle 1 is duplicated. Creating Circle 2, and has the Y-Position property linked to the property of Circle 1.
- After Effects creates a code
thisCopy.layer("Circle 1").transform.yPosition.Which reads, use the layer of Circle 1 and it’s transform property of the Y-Position value.
- Then the valueAtTime expression is added:
thisCopy.layer("Circle 1").transform.yPosition.valueAtTime(time-0.15);which means take the value at the time of Circle 1 and subtract it by 0.15 seconds in a delay.
- The expression is then tested hitting the space bar.
- Circle 2 Layer is duplicated. Circle 3 had its X-Position moved to the right. Then the time delay is changed from
- And this repeats to for Circle 4. The time delay changed to
0.35. When the animation is played back all four circles move up. One right after the other.