Trajectory for After Effects
Dynamically align your layers between 3d points in After Effects

Trajectory

The trajectory script will take all layers in a composition and plot them evenly on a line between 2 nulls in 3d space. When the script is run, it will take all layers in the selected composition and make them 3d. It then creates 3 nulls, 2 of these nulls are used to create the trajectory along which all layers lie. The third null is a control layer which will be discussed in a moment.

Any non null layer can be reordered in the timeline to change its position on the line; however, the 3 nulls must be the last 3 layers in the comp, and the control layer must be the last layer in the comp.

Getting Started

You can move the 2 nulls named "startPosition" and "endPosition" and all the layers in your comp will disperse evenly on a line between the 2 nulls.

Add keyframes to the nulls position and the layers will follow.

Control Layer

The "controlLayer" null controls the rotation and opacity of the layers. The "Transform Delay" slider allows you to offset each layers reaction to changes in the control layer...so if you have xRotation on the controlLayer keyframed from frame 1 to 10 and offset set to 5, layer 1 will do the xRotation from frame 1 to 10; layer 2 will transform from 6 to 15; and layer 3 will transform from frame 11 to 20.

The reverse delay checkbox will cause the delay to go from last layer to first layer instead of first to last.

Check the "Disable Control" checkbox if you would like to individually controll these parameters from each layer insted of the control layer

Compress Expand

The compress expand slider allows you to dynamically lengthen or shorten the length of your trajectory. A positive number will lengthen your line, a negative number will shorten it. a value of zero will give you a normal trajectory where the first layer will have the same position as the startPosition null and your last layer will have the same position as the endPosition null.

Adding Layers to your Trajectory

If you want to add a layer from your project to a trajectory comp, simply duplicate any layer in the comp that is not a null, select the dup, and alt+drag the item and drop it on the selected layer and it will become part of the trajectory.


Using Trajectory Comp in another Comp

If you put your trajectory comp inside your main comp and enable "collapse transformations" for that layer, your trajectory comp will become part of the scene and react to cameras.