Skip to Content
Core conceptsExpressions

Expressions

An expression replaces a property’s sampled value with a computed one, evaluated every frame. Use it when a relationship is easier to state than to keyframe: “always half the parent’s rotation”, “wobble around this value”, “follow that layer with a delay”.

The editor

Graph panel → ExpressionEditor.

  • Monospaced, with quick-insert autocomplete for the API.
  • Inline plain-language errors rather than a stack trace.
  • A live value that updates as you scrub the playhead — so you can see what the expression is producing before you commit to it.
  • AI assist produces an editable expression, never a locked black box. You can read it, change it, and delete the parts you do not want.

Expression controls

Controls are named inputs that live on a layer and can be referenced from any expression. They turn an expression into something with a UI.

ControlType
SliderNumber
AngleDegrees
Point2D vector
ColourRGBA
CheckboxBoolean
DropdownEnumerated choice
LayerA reference to another layer

Add Slider Control is in the top-bar Animate menu. It creates a named control you then reference:

ctrl('Wobble Amount')

Because the control is itself a property, it can be keyframed — which is how you animate the parameters of an expression rather than the value directly.

The language

A real expression language with vector support, evaluated per frame by the engine’s own interpreter. Expressions can read other properties, other layers, the current time and the composition’s parameters.

Expressions are evaluated by the engine’s interpreter, not by the JavaScript runtime. In development builds the content security policy blocks new Function outright — which is a deliberate constraint, and the reason the interpreter exists rather than an eval shortcut.

Expressions and keyframes together

An expression and a track are not mutually exclusive. The common pattern is:

  1. Keyframe the base motion.
  2. Add an expression that reads the sampled value and modifies it — adding a wobble, clamping it, offsetting it by another layer’s value.

That keeps the timing editable in the timeline while the expression handles the relationship.

When not to use one

  • If a preset does it. Wiggle, pulse, shake and sway all exist as presets that write ordinary keyframes, which are easier to retime later.
  • If you will need to hand the project to someone else. Keyframes are legible to anyone; an expression is legible to whoever wrote it.
  • If the relationship is one-off. Two keyframes beat a line of code for a single move.
Last updated on