How to Check if a Layer Is Active in After Effects

Determining whether a layer is currently active in Adobe After Effects is a fundamental technique for building dynamic, automated motion graphics templates and rigs. By evaluating a layer's temporal boundaries—specifically its in-point, out-point, and current playback time—you can trigger animations, toggle visibility, or drive property changes on other layers. This guide explains how to write After Effects expressions using time properties to evaluate a layer's active state accurately.

Method 1: Evaluating time Against inPoint and outPoint

The most common way to check if a layer is active using time properties is by comparing the composition's current playback time (time) to the layer's boundaries (inPoint and outPoint).

Every layer contains these built-in time values measured in seconds:

  • time: The current time of the composition.
  • inPoint: The point in time where the layer begins.
  • outPoint: The point in time where the layer ends.

To check if the current layer is within its active range, use the following expression:

var isActive = (time >= inPoint && time < outPoint);

If you need to check the active state of a different layer within the same composition, reference that layer directly:

var targetLayer = thisComp.layer("Target Layer Name");
var isActive = (time >= targetLayer.inPoint && time < targetLayer.outPoint);

This returns true when the playhead is inside the layer's duration and false when it is outside.

Method 2: Using the Built-In active Property

After Effects also provides an integrated shorthand property called active. This property evaluates the layer's temporal position and returns a boolean value (true or false). It also accounts for whether the layer's video switch (the eye icon) is turned on.

To check the active state of another layer:

var isActive = thisComp.layer("Target Layer Name").active;

While .active is simpler, comparing time >= inPoint && time < outPoint manually is preferred if you want to evaluate playback status purely based on time markers regardless of the layer's visibility switch.

Practical Example: Driving Opacity Based on Activity

To make Layer B visible only when Layer A is active across the timeline, apply this expression to the Opacity property of Layer B:

var target = thisComp.layer("Layer A");

if (time >= target.inPoint && time < target.outPoint) {
    100;
} else {
    0;
}

This ensures Layer B dynamically responds to any trimming or time-shifting performed on Layer A.