v0.145.4Internal beta docs

Beta documentation · eXLib v0.145.4. Public release is pending.

Rig an Expression with Controls

Turning a working expression into something an animator can tune — sliders, a colour, a checkbox — without them opening the code.

The task

  1. Decide which values in the expression should be tunable.
  2. Create a control for each one, on a layer you choose.
  3. Rewrite the expression to read the controls instead of the literals.
  4. Keep the two in sync from then on.

How it goes in plain After Effects

  1. Pick a host layer. Usually a null: Layer → New → Null Object.

  2. Add one control per value: Effect → Expression Controls → Slider Control (or Angle, Colour, Checkbox, Point, 3D Point, Layer, Dropdown Menu).

  3. Rename each one in Effect Controls — select it, press Return, type the name.

  4. Point the expression at each control, either by dragging AE's pickwhip onto the control's value or by typing the reference:

    thisComp.layer("Ctrl").effect("Radius")("Slider")
    
  5. Repeat for every value. Each control you add is its own undo step, and each reference is typed or picked separately.

!

The reference is by name. Rename the effect or the layer afterwards and the expression stops resolving until you edit it to match.

i

Five or six controls on a layer that already carries real effects makes a long Effect Controls stack, and nothing in it says which entries belong to the expression.

What changes with eXLib

The values become variables, and the controls get created for you.

  • Detect reads the expression and proposes which literals are worth a variable, each with its reason. You accept the ones you want — a row at a time, or Tokenize all.
  • Each variable is wired to a target: a New control, an existing property via Link property…, or Ask on apply.
  • The control's kind is chosen on the control's own row, and the menu marks the kind the variable actually needs. A kind that contradicts the need still applies — it warns, it doesn't block.
  • The destination layer is yours to pick. The picker is titled Choose the destination layer, defaults to the layer you're applying to, and offers Control null (new layer) if you'd rather the controls landed on a fresh null.
  • Apply creates every control, substitutes each one's real, collision-safe name into the code, and sets the expression — as one undo group.

Or deliver them as one pseudo effect instead. The delivery selector at the top of the Variables panel switches from Native controls to Pseudo effect: the same controls arrive as parameters of a single custom effect rather than as a stack of separate ones. Pseudo Effect Authoring is where that rig is arranged.

✓

A pseudo effect can also be pulled back off a layer, edited, and placed back — including one that already carries keyframes and expressions. Place-back pairs each old control against its counterpart, shows you the pairing before it runs, and migrates keyframes and expressions across in one undo group. See Pull, Edit, Place Back.

Step by step

Step In plain After Effects With eXLib
1. Decide what's tunable Read the code and pick the numbers out by eye Detect proposes them, each with its reason — accept one, or Tokenize all
2. Name them Not a step — the literal has no name Rename a variable inline; every {{name}} in the code is rewritten with it, as one undo
3. Choose where controls live Create/choose a layer, then add effects to it manually Pick it once in Choose the destination layer — the target layer by default, any other layer, or Control null (new layer)
4. Create the controls Effect → Expression Controls → …, once per control Nothing to do — Apply creates them
5. Name the controls Select each in Effect Controls, Return, type Nothing to do — the variable's name is the control's name
6. Pick each control's type Choose the right Expression Control from the menu yourself The kind menu marks the kind the variable needs; every kind stays selectable, a contradicting one warns
7. Wire the code to the controls Pickwhip or type one reference per control Nothing to do — Apply substitutes each control's real name into the code
8. Commit Several separate steps, several undo entries One Apply, one undo group
9. Avoid a 6-effect stack Not addressed — the controls are separate effects Switch delivery to Pseudo effect: one custom effect carrying every parameter
10. Change the rig later AE lets you rename only the effect instance; its internal controls are not editable there Pull the rig into Pseudo Effect Authoring, edit it, then place it back — keyframes and expressions migrate