Expressions in Adobe After Effects are JavaScript-based code snippets that automate animations without manually placing thousands of keyframes.
Whether you are automating a physical clock or building complex UI timers, these five essential time and timer-related expressions will drastically improve your workflow. 1. The Core time Expression
This is the baseline expression for creating continuous, infinite linear animation. It reads the current playback time of your composition in seconds and scales it. Code: time150
Best Used For: Constant rotation (like clock hands, gears, or windmills) and driving repeating texture evolutions.
How It Works: Multiplying time by a number dictates the speed per second. For example, applying time * 360 to a layer’s Rotation property forces it to complete one full revolution every single second. 2. The Dynamic loopOut() Expression
Instead of copy-pasting your keyframes forever, this loops a specific sequence endlessly after your final keyframe. Code: loopOut(“cycle”);
Best Used For: Walk cycles, ticking clock needles, swinging pendulums, and background UI loops.
How It Works: Apply this to any keyframed property. The “cycle” modifier loops the animation from the start keyframe to the end keyframe seamlessly. You can also change the parameter to “pingpong” to make the animation play forward and then backward. 3. Step-Motion Time with posterizeTime()
This expression forces an animation to run at a lower, specific frame rate regardless of the composition settings. Code: javascript posterizeTime(12); time * 100; Use code with caution.
Best Used For: Simulating a stylized stop-motion aesthetic, retro claymation styles, or choppy loading timers.
How It Works: Placing posterizeTime(12) above another time-based property tells After Effects to only update that property 12 times a second, instead of matching the smooth 24fps or 60fps of the master composition. 4. Delayed Animation via valueAtTime()
This powerful function samples a property’s value from another point in time, allowing you to offset and delay movements dynamically.
Code: thisComp.layer(“Leader Layer”).transform.position.valueAtTime(time - 0.5);
Best Used For: Follow-the-leader text effects, kinetic typography, and offset hands on a complex multi-timezone clock.
How It Works: This tells the current layer to look at a layer named “Leader Layer” and copy its position precisely, but with a calculated 0.5-second time delay. 5. Precise Slider Countdown / Count-up Timer
When you need a literal visual countdown on screen (e.g., minutes and seconds), this UI expression converts a slider control value into clean text formatting. 5 Basic Expressions you need to know in After Effects!
Leave a Reply