Glyph Animation Using Expression Selectors in After Effects
Glyph-level animation using Expression Selectors in Adobe After Effects is an advanced motion typography technique that leverages code to procedurally animate individual text characters. Rather than manually keyframing each letter or relying on standard range-based sliders, this approach uses mathematical expressions to dynamically control typographic properties such as position, scale, opacity, and rotation. This overview explains how Expression Selectors work, the built-in variables that drive them, and why they are essential for creating scalable, procedural text animations.
Understanding Glyph-Level Animation
In typography and digital design, a glyph is an individual visual representation of a character—a single letter, number, symbol, or punctuation mark. In standard After Effects workflows, text animators allow you to manipulate properties across a block of text. Glyph-level animation takes this further by treating every individual character as an independent transformable element, allowing for complex behaviors like cascading waves, randomized organic jitters, or spatial ripples across words and sentences.
The Role of the Expression Selector
Text layers in After Effects include dedicated "Animators" that modify properties like Position, Tracking, or Rotation. By default, these animators use a Range Selector, which defines boundaries using percentage-based "Start" and "End" parameters.
An Expression Selector replaces or supplements the Range Selector. Instead of relying on static keyframes to sweep across a line of text, it uses JavaScript-based expressions to calculate the exact degree of influence—from 0% to 100%—that an animator has on each specific character at any given frame.
Key Built-In Variables
Expression Selectors feature specific variables designed exclusively for text manipulation:
textIndex: Returns the index number of the current glyph (starting at 1 for the first character and incrementing sequentially).textTotal: Returns the total count of characters, words, or lines being evaluated.selectorValue: Represents the current value that the Range Selector (if present) or default selector passes to that character, allowing you to combine standard keyframes with programmatic offsets.
Because the expression evaluates once per glyph per frame,
referencing textIndex allows you to create math functions
that dynamically vary based on where a character sits in the string.
How It Works in Practice
When you add an Animator (such as Scale set to 0%) and attach an Expression Selector, After Effects requires the expression to return a single percentage value or an array representing the influence on that glyph.
For instance, an expression can calculate a delay based on character position:
delay = 0.05;
myDelay = (textIndex - 1) * delay;
value = ease(time - myDelay, 0, 0.5, 100, 0);In this scenario:
- The first letter (
textIndex = 1) evaluates immediately at timet. - The second letter (
textIndex = 2) delays its evaluation by 0.05 seconds. - Every subsequent character animates sequentially without a single manual keyframe.
Advantages of Expression-Driven Glyph Animation
- Responsive to Dynamic Text: If you change the
source text from a short word to a full paragraph, the expression
automatically recalculates using
textTotalandtextIndex. The timing and visual distribution remain intact without re-keyframing. - Mathematical Precision: Animators can utilize
trigonometric functions (like
Math.sin()orMath.cos()) to generate continuous, looping wave patterns across characters. - Audio and Controller Integration: Character movement can be tied to external null objects, audio amplitude data, or spatial proximity to the composition's mouse/camera coordinates.