After Effects Script: Center Layer in Active Camera’s View

(UPDATE from July 16, 2014: This script has been superseded by keen_3dLayerTools [link], a new version with more features.)

In After Effects, when you promote a layer from 2D to 3D, it will seem to jump, possibly out of frame, unless your camera is in the default position. This is because Ae is keeping the numeric values of your old 2D coordinates and simply adding one for the Z-axis; it is not attempting to translate them into the 3D space you see in the viewer.

Ctrl+Home (PC) or Cmd+Home (Mac) will re-position the layer in the center of the camera’s view, but it will not auto-orient the layer the camera.

I’ve written a quick, 1-button script that sets the selected layers’ positions to the focal point of the camera and orients them to the camera, centering them in view. If the layer is 2D, the script promotes it to 3D, and if there is no active camera in the comp, it adds a camera.

If you run across any bugs, please report them below.

Download keen_centerLayersToActiveCamera

Unzip the script and drop it in your ScriptUI folder. Relaunch After Effects, then open it from the Window menu.

Posted by Walter Soyka


[…] I previously published a script which centers and orients layers to the active camera [link]. […]

Leave a Reply