Add layer
ae_add_layerAdds a new layer—solid, text, shape, null, adjustment, camera, light, or project item—to an After Effects composition, returning its index, id, and name.
Instructions
Add one new layer to a composition: solid, text, shape (empty, use ae_add_shape to draw), null, adjustment, camera, light, or an existing project item (footage/comp). Each call adds another layer, on top unless moveToIndex is given. Returns the new layer's index, id and name. Text options apply to text layers only. To edit existing text use ae_set_text, for switches, timing or parent ae_set_layer_attributes (both via ae_call).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Composition: item id (number) or exact name. Omit (or "active") for the active/open composition. | |
| font | No | PostScript font name, e.g. "Arial-BoldMT", "Helvetica", "Montserrat-Bold". | |
| item | No | For type 'item' (required there): project item to add. | |
| name | No | Layer name (default: After Effects' name, e.g. "Solid", "Camera"). | |
| text | No | For type 'text': the text (default empty). | |
| type | Yes | Layer kind; 'item' adds the project item given in item. | |
| color | No | Solid/adjustment color, or light color. | |
| width | No | Solid/adjustment width in pixels (default: comp width). | |
| height | No | Solid/adjustment height in pixels (default: comp height). | |
| threeD | No | Make the layer 3D. | |
| allCaps | No | Text: all caps. | |
| boxSize | No | Paragraph (box) text size [w,h]; omit for point text. | |
| leading | No | Text: line spacing in pixels (turns auto leading off). | |
| duration | No | Layer duration in seconds (default comp duration). | |
| fauxBold | No | Text: faux bold. | |
| fontSize | No | Text: font size in pixels. | |
| position | No | Layer position [x,y] or [x,y,z] in comp pixels (cameras and lights default to the comp center). | |
| tracking | No | Text: tracking (After Effects units, 1/1000 em). | |
| direction | No | Paragraph direction (AE 24+). Default: text without Hebrew/Arabic characters is set left to right whatever the user's AE type preference is. | |
| fillColor | No | Text: fill color, "#rrggbb" or [r,g,b]. | |
| lightType | No | For type 'light' (default: After Effects' default). | |
| startTime | No | Layer start time in seconds (comp time). | |
| fauxItalic | No | Text: faux italic. | |
| moveToIndex | No | Move the new layer to this 1-based index (new layers are added on top). | |
| strokeColor | No | Text: stroke color, "#rrggbb" or [r,g,b]. | |
| strokeWidth | No | Text: stroke width in pixels. | |
| justification | No | Text: paragraph alignment. |