0% found this document useful (0 votes)
6 views12 pages

Ae Rotation Expressions Guide

This document is a guide for animating rotation in After Effects using two expressions: Pendulum Swing and Elastic Snap Turn. The Pendulum Swing creates a continuous oscillation, while the Elastic Snap Turn provides a one-shot rotation with spring-like overshoot and bounce. Each expression is customizable with parameters and can be applied without keyframes, making them efficient for motion design.

Uploaded by

tohuuphan1412
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views12 pages

Ae Rotation Expressions Guide

This document is a guide for animating rotation in After Effects using two expressions: Pendulum Swing and Elastic Snap Turn. The Pendulum Swing creates a continuous oscillation, while the Elastic Snap Turn provides a one-shot rotation with spring-like overshoot and bounce. Each expression is customizable with parameters and can be applied without keyframes, making them efficient for motion design.

Uploaded by

tohuuphan1412
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

After Effects Expression Guide

AFTER EFFECTS
EXPRESSION GUIDE

Two Essential Turn Left / Turn Right Expressions

Pendulum Swing + Elastic Snap Turn

Motion Design Reference | 2026 Edition

Page 1
After Effects Expression Guide

Introduction

Rotation is the silent workhorse of motion design. A well-crafted turn left or turn right can
communicate hesitation, emphasis, playfulness, or weight. Unlike position or scale, rotation
carries an implicit sense of physics — objects in the real world do not simply rotate from A to B;
they swing, wobble, overshoot, and settle.
This guide presents two expression-based approaches to animating rotation in After Effects.
Both are applied directly to the Rotation property. No keyframes are needed. Each produces a
distinct motion character and can be tuned with a handful of parameters.

The Two Expressions


1. Pendulum Swing — A smooth, continuous oscillation between left and right, like a
metronome or a clock pendulum. The motion is symmetrical, looping, and meditative.
Uses smoothstep easing on a triangle wave for buttery direction changes.
2. Elastic Snap Turn — A one-shot turn that overshoots, bounces, and settles using
spring physics. The object snaps to a target angle with momentum, creating a physical,
weighted feel. Ideal for reveals, transitions, and interactive triggers.

Expressions vs. Keyframes for Rotation


Keyframed rotation requires manually shaping the speed graph for every turn. The ease-in,
ease-out, and overshoot must be crafted by hand, and any change to the target angle or timing
means reworking the entire curve. Expressions encode the motion behavior as a formula.
Change one number and the entire animation recalculates.
Both expressions in this document output a single value (degrees) that After Effects applies to
the Rotation property. They use comp time as the clock, so they are layer-order independent
and will work on any layer in any composition.

How to Apply
• Select your layer in the timeline.
• Expand Transform and find Rotation.
• Hold Alt (Windows) or Option (Mac) and click the stopwatch icon next to Rotation.
• Paste the expression into the editor that appears.
• Adjust the parameter values at the top of the expression to taste.

Page 2
After Effects Expression Guide

Expression 1: Pendulum Swing

This expression creates a continuous, smooth oscillation. The object rocks left and right like a
pendulum, with perfectly eased direction changes at each extreme. The motion loops
seamlessly and never stops, making it ideal for ambient animation, idle states, and atmospheric
elements.

The Expression
Apply to Rotation property:
// === PENDULUM SWING ===
maxAngle = 25; // degrees to each side
cycleDur = 2.5; // full left-right-left cycle (seconds)
startTime = 0.0; // when swing begins

t = time - startTime;

if (t < 0) {
value;
} else {
// Normalized cycle position (0 to 1)
cycle = (t % cycleDur) / cycleDur;

// Triangle wave: 0 -> 1 -> 0 over one cycle


tri = 1 - [Link](cycle * 2 - 1);

// Smoothstep easing for soft direction changes


eased = tri * tri * (3 - 2 * tri);

// Map 0-1 to -maxAngle to +maxAngle


angle = -maxAngle + (maxAngle * 2) * eased;

value + angle;
}

Page 3
After Effects Expression Guide

How It Works
The Pendulum Swing expression builds its motion from three mathematical layers. First, a
modulo operation divides time into repeating cycles. No matter how long the composition runs,
the value always wraps back to the start of a new cycle at the interval defined by cycleDur.
Second, a triangle wave converts the linear cycle position into a value that ramps from 0 to 1
during the first half of the cycle, then back from 1 to 0 during the second half. This creates the
back-and-forth motion.
Third, the smoothstep function applies S-curve easing. Without it, the object would change
direction abruptly at each extreme. Smoothstep rounds off these corners, creating the feeling of
deceleration at the peaks and acceleration through the center — exactly how a physical
pendulum behaves.
The final line adds the computed angle to value, which is After Effects’ keyword for the
property’s current manual setting. This means if you’ve rotated the layer to 15° by hand, the
swing oscillates around 15°, not around 0°.

Parameter Reference
Parameter Default Effect
maxAngle 25 Degrees of rotation to each side. 25 = swings
from -25° to +25°.
cycleDur 2.5 Duration of one full oscillation cycle in
seconds.
startTime 0.0 Comp time when the swing begins. Before
this, layer holds its manual rotation.

Page 4
After Effects Expression Guide

Tuning Presets
The Pendulum Swing is controlled by just two creative parameters. Here are combinations for
different moods:

Gentle Sway (hanging sign, plant leaf)


maxAngle = 8; cycleDur = 3.5;
// Slow, small arc. Peaceful and ambient.

Ticking Clock (metronome, countdown)


maxAngle = 30; cycleDur = 1.0;
// Fast, wide arc. Mechanical and urgent.

Wrecking Ball (heavy, dramatic)


maxAngle = 45; cycleDur = 4.0;
// Very wide, slow swing. Cinematic weight.

Nervous Twitch (anxiety, tension)


maxAngle = 3; cycleDur = 0.4;
// Tiny, rapid. Almost vibration-like.

Damped Variant (Swing That Stops)


To make the pendulum gradually lose energy and come to rest, multiply the angle by an
exponential decay:
// === DAMPED PENDULUM ===
maxAngle = 35;
cycleDur = 2.0;
startTime = 0.5;
decayRate = 1.5; // how fast swing dies

t = time - startTime;

if (t < 0) {
value;
} else {
cycle = (t % cycleDur) / cycleDur;

Page 5
After Effects Expression Guide

tri = 1 - [Link](cycle * 2 - 1);


eased = tri * tri * (3 - 2 * tri);
angle = -maxAngle + (maxAngle * 2) * eased;

// Decay envelope: amplitude shrinks over time


envelope = [Link](-decayRate * t);

value + angle * envelope;


}

The decay envelope starts at 1.0 and exponentially approaches 0. After roughly 3–4 seconds
(depending on decayRate), the swing amplitude is essentially zero and the object holds still at
its manual rotation. This is perfect for a hanging object that has been bumped and gradually
settles.

Page 6
After Effects Expression Guide

Expression 2: Elastic Snap Turn

This expression creates a one-shot rotation from the current angle to a target angle, with spring-
physics overshoot and bounce. The object snaps toward the target, overshoots past it, oscillates
back and forth with decreasing amplitude, and settles. It feels like a physical object with mass
and momentum.

The Expression
Apply to Rotation property:
// === ELASTIC SNAP TURN ===
startTime = 1.0; // when the turn fires
targetAngle = 45; // final resting angle
amp = 20; // overshoot amplitude (degrees)
freq = 2.5; // oscillation frequency
decay = 4.5; // how fast bounce settles

t = time - startTime;

if (t < 0) {
value; // hold manual rotation
} else {
// Spring overshoot formula
overshoot = amp * [Link](freq * t * [Link] * 2);
damping = [Link](-decay * t);
targetAngle + overshoot * damping;
}

How It Works
The Elastic Snap Turn combines two mathematical functions to simulate spring physics. A sine
wave generates the oscillation (the back-and-forth rocking past the target), while an exponential
decay envelope progressively reduces the amplitude of each successive bounce.
At the moment of trigger (startTime), the sine value is at zero, meaning the object starts exactly
at the targetAngle. Within the first quarter of the oscillation cycle, it overshoots by the full
amplitude. Each subsequent oscillation is smaller than the last. After roughly 0.5 to 1.0 seconds
(depending on the decay rate), the bouncing is imperceptible and the object rests at
targetAngle.

Page 7
After Effects Expression Guide

Unlike the Pendulum Swing, this expression does not loop. It fires once and settles. This makes
it ideal for triggered events: a logo turn, a card flip, a dial snap, or any moment where an object
needs to arrive at a specific angle with physical conviction.

Parameter Reference
Parameter Default Effect
startTime 1.0 Comp time when the turn begins. Object holds
manual rotation before this.
targetAngle 45 Final resting angle in degrees. Positive =
clockwise, negative = counter-clockwise.
amp 20 Overshoot strength in degrees. Higher =
bigger initial bounce past target.
freq 2.5 Oscillation speed. Higher = faster wobble
cycles.
decay 4.5 Settle speed. Higher = bounce dies faster.

Page 8
After Effects Expression Guide

Tuning Presets
By adjusting amp, freq, and decay, the same expression produces vastly different motion
characters:

Crisp UI Turn (toggle switch, tab indicator)


targetAngle = 90; amp = 6; freq = 3.0; decay = 8;
// Tight, snappy. Barely visible overshoot.

Cartoon Whip (playful, exaggerated)


targetAngle = -60; amp = 35; freq = 2.0; decay = 2.5;
// Big bounce, slow settle. Very animated.

Heavy Gate (weighted, industrial)


targetAngle = 90; amp = 15; freq = 1.2; decay = 3;
// Low frequency, slow decay. Feels massive.

Nervous Flick (quick, anxious)


targetAngle = 12; amp = 8; freq = 4.0; decay = 6;
// Small angle, fast wobble. Jittery energy.

Multi-Turn Variant (Sequential Snap Turns)


To chain multiple turns at different times, use conditional blocks:
// === MULTI SNAP TURN ===
amp = 15; freq = 2.5; decay = 5;

// Define turns: [startTime, targetAngle]


turns = [[1.0, 30], [3.5, -20], [6.0, 45], [8.5, 0]];

// Find the most recent turn


angle = value;
activeStart = -1;
activeTarget = value;

for (i = 0; i < [Link]; i++) {


if (time >= turns[i][0] && turns[i][0] > activeStart) {

Page 9
After Effects Expression Guide

activeStart = turns[i][0];
activeTarget = turns[i][1];
}
}

if (activeStart < 0) {
value;
} else {
t = time - activeStart;
overshoot = amp * [Link](freq * t * [Link] * 2);
damping = [Link](-decay * t);
activeTarget + overshoot * damping;
}

This variant stores an array of turn events. At any point in time, the expression finds the most
recent turn that has fired and applies the elastic bounce relative to that turn’s start time and
target angle. The object snaps to 30° at 1.0s, then snaps to −20° at 3.5s, and so on. Each turn
gets its own independent bounce.

Page 10
After Effects Expression Guide

Comparison and When to Use Each

Both expressions animate the Rotation property, but they serve fundamentally different
purposes. The Pendulum Swing is a continuous ambient effect; the Elastic Snap Turn is a
triggered event. Choosing correctly is a matter of intent.

Aspect Pendulum Swing Elastic Snap Turn


Motion type Continuous oscillation One-shot event
Looping Loops forever by default Fires once and settles
Overshoot None (smooth peaks) Yes (spring bounce)
Physics feel Gravity / pendulum Spring / momentum
Direction Rocks left and right equally Turns to a specific angle
Best for Idle states, ambient, atmosphere Reveals, triggers, transitions
Parameters 3 (simple) 5 (more control)
Easing Smoothstep S-curve Exponential decay
Emotional tone Hypnotic, rhythmic, calm Decisive, physical, punchy

Combining Both Expressions


A powerful technique is to combine both expressions on the same layer at different phases. Use
the Elastic Snap Turn for the object’s entrance (snapping from off-angle to its resting position
with a bounce), then transition into the Pendulum Swing for an ambient idle state while the
object remains on screen.
To implement this, use a conditional time check: if the current time is within the snap turn’s
active window (roughly 1–2 seconds after its startTime), use the elastic formula. After the
bounce has fully decayed, switch to the pendulum formula. The transition is invisible because
both expressions settle to the same resting angle.

Tips for Professional Results


• Always use value + angle (not just angle) to preserve manual rotation offsets. This lets
you position the layer in the comp without fighting the expression.
• Keep overshoot amplitudes proportional to the target angle. A 5° turn with 40° of
overshoot looks broken. A good starting ratio is amp = targetAngle * 0.3 (30%
overshoot).

Page 11
After Effects Expression Guide

• For the Pendulum Swing, slower cycles with smaller angles read as heavier. Fast cycles
with small angles read as nervous. Slow cycles with large angles read as dramatic.
• Test at actual playback speed, not scrubbing. Rotation expressions are time-sensitive
and their character changes significantly at different frame rates.
• Both expressions use time (comp time), not inPoint. They are safe to use regardless
of where the layer sits in the timeline.

End of Guide

Page 12

You might also like