Using the Checkbox Expression Control in After Effects

After Effects June 5, 2019 2 min read

You don’t only have to use the eye icon to turn your layers on and off in After Effects. In this short tutorial, you’ll learn how to easily use the checkbox expression controller to turn layers on and off throughout your After Effects projects. This can be extremely useful in some cases, especially when creating After Effects templates. Let’s dive in!

How to Use the Checkbox Controller

Step 1: Add a Checkbox Control to your project

Follow these steps to set up a quick composition so you can practice with the controller. Then try applying it to your existing projects.

  1. Create a New Composition in 1920×1080.
  2. Go to Layer > New > Solid.
  3. Drag Comp 1 into a new comp, Comp 2.
  4. Go to Layer > New > Adjustment Layer.
  5. On the adjustment layer, go to Effect > Expression Controls > Checkbox Control. Name is something like “Box.”

Step 2: Re-Align your Project Setup

Before going further, quickly shuffle some windows around just to make it easier to see where everything is.

  1. Pull the Comp 2 up to the middle of the screen, so it docks below the preview window.
  2. Twirl down the adjustment layer with the Effects controller open and the Box effect controller open.

Step 3: Add an Expression

Use an expression to control the opacity instantly, and to create the ability to turn a layer on/off.

  1. In Comp 1, open up the Opacity controls (T on the keyboard) 
  2. Alt + Click the stopwatch to open up the expression box.
  3. Enter the following expression:

if ( comp(“Comp 2”).layer(“Adjustment Layer 2”).effect(“Box”)(“Checkbox”) > 0 ) {100} else {0}

This is essentially saying if this checkbox is greater than 0, we want the opacity to be 100. If it’s not greater than 0, the opacity will be 0.

  1. Bring Comp 2 back down to sit beside Comp 1. 
  2. Beneath the adjustment layer, selecting the Checkbox to be On/Off should now switch that layer on and off, by switching the opacity from 0 to 100.

And that’s it. Using an expression makes it super easy to toggle layers on and off rather than navigating through to the eye icon each time. This is great for when making After Effects templates and will help you work more quickly.