align_to_targets
Batch-centers layers on target layers in comp space, resolving full parent chains and offsets so elements parented to scaled or rotated nulls align correctly.
Instructions
Batch paired alignment: center each layer's comp-space visual center onto its target layer's center, plus an optional offset. Unlike align_layers (own-transform only), this walks the FULL parent chain, so labels/numbers parented to scaled or rotated nulls/buttons resolve to true comp coordinates and land correctly. Pair via pairs:[{layer,target}] or parallel layers[]+targets[]. offset [dx,dy] is comp px added to every target center (same offset on all pairs = uniform "normalize"). axis locks an axis (x/y/both). Solves each layer's LOCAL position from the comp-space target, so non-uniform/animated parent scale is handled exactly. Skips layers whose Position has an active expression. 2D layers only (3D/camera not projected). e.g. center "Num N" on "Key N" with offset [0,-23], then "Letters N" on "Key N" with [0,50].
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "align_to_targets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| axis | No | both | |
| comp | No | Comp: name (string), or { id: N } for duplicate-name-safe stable-id addressing. Defaults to active comp. | |
| time | No | ||
| frame | No | ||
| pairs | No | Explicit (layer, target) pairs. | |
| layers | No | One or many layers (each: name, 1-based index, or { id: N }). If omitted, uses currently selected layers. | |
| offset | No | comp-space [dx,dy] added to each target center. default [0,0]. | |
| targets | No | Reference layer(s), zipped 1:1 with layers[] when pairs is omitted. | |
| instance | No | Target a specific AE when more than one is connected (e.g. "2026", "2025", or a major like "26"). Omit when only one AE is open — see list_instances. |