Align layers
align_layersAlign After Effects layers by edges or centers relative to the composition, selected layers, or a reference layer, including rotated and 3D layers.
Instructions
Align layers like the Align panel: left/right/top/bottom edges or hcenter/vcenter/center, relative to the comp frame, the bounding box of the given layers ('selection', default for 2+ layers) or one reference layer. Bounds = axis-aligned box of the layer's content (sourceRectAtTime) after scale/rotation/parenting, in comp pixels. Rotated layers are aligned by their rotated bounding box. 3D layers are measured through the active camera and moved iteratively (approximate). Animated positions are shifted as a whole (all keyframes). Cameras/lights are not allowed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"edge": "<edge>"
},
"name": "align_layers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Composition name, 'Folder/Name' path, or item id. Omit to use the active composition. | |
| edge | Yes | hcenter = align horizontal centers (same x). | |
| time | No | Comp time at which content bounds and transforms are measured (default: current time). | |
| layers | No | Layers: array of layer refs, or 'selected' (default) or 'all'. | |
| toLayer | No | Reference layer when relativeTo='layer' (it does not move). | |
| relativeTo | No | Default: 'selection' for 2+ layers, else 'comp'. |