Using Time Expressions In Adobe After Effects

A Timer Expression is a powerful tool that allows you to create complex animations and effects based on time. This expression is written in JavaScript and can be applied to any property in After Effects to manipulate its value over time.

December 10, 2024
Using Time Expressions In Adobe After Effects

Adobe After Effects Time Expression

What The Timer Expression Does

The Timer Expression in After Effects is primarily used to create countdown timers or animations that change based on time. By leveraging the expression engine in After Effects, users can automate tasks and create animations that react to the passage of time. In Adobe After Effects Video edits, the time expression is a built-in variable that represents the current time (in seconds) of the composition. It dynamically changes as the playhead moves through the timeline. This makes it a powerful tool for creating time-based animations and effects without needing to keyframe every detail.

Opacity Fade Expression

t = time;
value = Math.sin(t) * 100;

What The Timer Expression Does

The Timer Expression in After Effects is primarily used to create countdown timers or animations that change based on time. By leveraging the expression engine in After Effects, users can automate tasks and create animations that react to the passage of time.

How To Use It

To use a Timer Expression, you first need to open After Effects and import your footage or create a new composition. Once you have your composition set up, you can select the layer you want to apply the expression to and press the “E” key to reveal all of the properties of that layer.

Next, you’ll want to find the property you want to animate with the Timer Expression. This could be the position, scale, opacity, or any other property of the layer. Once you’ve found the property, alt-click (or option-click on a Mac) on the stopwatch icon next to the property to open the expressions editor.

In the expressions editor, you can type in your Timer Expression. The expression will typically start with a variable that represents time, such as “t = time;”. You can then use this variable to create a mathematical equation that will determine the value of the property over time.

For example, if you wanted to create an animation where a layer’s opacity fades in and out over time, you could write a Timer Expression like this:

t = time;
value = Math.sin(t) * 100;


This expression sets the opacity of the layer to the sine of the current time, multiplied by 100. This will create a smooth fading in and out effect.

Once you’ve written your Timer Expression, you can click away from the expressions editor and play back your composition to see the effect in action. If you need to make adjustments, you can go back into the expressions editor and tweak the equation until you get the look you want.

Examples of Using the time Expression

1. Constant Rotation

  • To make a layer rotate continuously, apply this expression to the Rotation property:
  • javascript
  • Copy code
  • time * 30
  • This rotates the layer at 30 degrees per second.

2. Linear Movement

  • To make a layer move horizontally across the screen:
  • javascript
  • Copy code
  • [time * 200, value[1]]
  • Here, the X position increases by 200 pixels every second, while the Y position remains constant.

3. Oscillating Opacity

  • Create a pulsing effect for opacity:
  • javascript
  • Copy code
  • Math.sin(time * 2) * 50 + 50
  • This oscillates the opacity value between 0 and 100 over time.

4. Linking to Time Remaining

  • Use time in countdowns or timers to calculate remaining time:
  • javascript
  • Copy code
  • Math.max(0, 10 - time)
  • This counts down from 10 seconds to 0.

Practical Applications

  • Looping Animations: Use time % X to create repetitive animations, where X is the duration of the loop.
  • Syncing Effects: Align animations like text scaling, opacity fading, or progress bars with the timeline.
  • Dynamic Motion: Combine time with other math functions (e.g., sin, cos, random) to generate organic and procedural animations.

The time expression is a versatile tool for automating and enhancing your animations, saving time, and adding professional polish to your projects.