User Guide Cancel

Using expression controls

Link your expressions to Expression Controls so you can control and keyframe their values just like you do with effects.

Using expression controls with your expressions makes them more dynamic and easier to update. Rather than always needing to modify the values inside the expression editor, you can link them to an Expression Control in the Effect Controls panel. A single control can affect several properties at once.

You can use them to control parameters within your expressions. You can add a slider that moves a layer only within certain limits, or let the user select between several options by choosing from a dropdown menu. You can add checkboxes that turn layers on or off, or change color schemes on text and graphics layers. You can add angle controls that drive the rotation of several layers, and you can add color controls that change the color of text, glows, or shapes.

The names for the Expression Control effects indicate what type of property control they provide: Angle Control, Checkbox Control, Color Control, Layer Control, Point Control, Slider Control, and Dropdown Menu Control.

Note:

If you apply an animation preset from the Animation Presets > Shapes > Backgrounds category, you can see a custom Animated Shape Control effect in the Effect Controls panel. This custom effect is a specialized expression control effect that was created specifically for these animation presets. You can copy and paste this effect to other layers, or you can save it as an animation preset itself so that you can apply it elsewhere.

Apply expression controls to layers

You apply Expression Controls effects to a layer in the same ways that you apply other effects, such as dragging the effect onto the layer from the Effects & Presets panel.

You can apply Expression Controls effects to any layer; however, it is useful to apply them to a null layer, which you can simply use as a controlling layer. You then add expressions to properties on other layers to take input from that control. For example, you can add the Slider Control effect to a null layer (Null 1), and then apply this expression to the Position properties of multiple layers:

position+[0,10*(index-1)*thisComp.layer("Null 1").effect("Slider Control")("Slider")]
position+[0,10*(index-1)*thisComp.layer("Null 1").effect("Slider Control")("Slider")]
  position+[0,10*(index-1)*thisComp.layer("Null 1").effect("Slider Control")("Slider")]

In this example, as you drag the slider, each layer with this expression moves. The layers with greater index numbers (layers toward the bottom in the Timeline panel) are shifted more than the layers with lower index numbers, at 10-pixel intervals. You can set keyframes for the slider on the null layer, and all the other layers animate accordingly.

It is often useful to rename each instance of an Expression Control effect to indicate its use. For example, renaming an instance of the Color Control effect to sky color makes it easier to tell what the effect is controlling. You can rename each instance of an Expression Control effect just as you rename any other effect: select it in the Timeline panel or Effect Controls panel and press Enter on the main keyboard (Windows) or Return (Mac OS).

Note:

To modify the range of a control, right-click (Windows) or Control-click (Mac OS) the underlined property value for the control and choose Edit Value from the context menu.

Convert an expression to keyframes

In some situations, it’s useful to convert an expression to keyframes. For example, if you want to freeze the values in an expression, you can convert the expression to keyframes and then adjust the keyframes accordingly. If an expression takes a long time to evaluate, you can convert it to keyframes so that it renders more quickly. When you convert an expression to keyframes, After Effects evaluates the expression, creating a keyframe at every frame, and then disables the expression.

In the Timeline panel, select the property on which the expression is written and choose Animation > Keyframe Assistant > Convert Expression To Keyframes. The original expression is preserved, only disabled.

More Expression resources

Now that you have understood some of the concepts behind expressions, come to the community for some real-life examples, and to share your work.

You can also check out Dan Ebberts' excellent collection of example expressions and tutorials on his MotionScript website.

The AE Enhancers forum also provides many examples and much information about expressions, as well as scripts and animation presets.

Get help faster and easier

New user?