Add a layer
ae_add_layerAdd any layer type to an After Effects composition—text, solid, shape, null, adjustment, camera, light, or footage—and receive the new layer's index.
Instructions
Add a layer to a composition: text, solid, shape, null, adjustment, camera, light, or existing footage/comp from the project. Returns the new layer's index.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Composition name, project item id, or index. Omit for the active comp. | |
| font | No | text layers: PostScript font name, e.g. 'Helvetica-Bold'. | |
| name | No | Layer name. Defaults to something sensible per type. | |
| text | No | text layers: the string to display. Use \n for line breaks. | |
| type | Yes | What kind of layer to create. | |
| color | No | text fill, solid color, or shape fill. | |
| shape | No | shape layers: which primitive to draw. Default: rectangle. | |
| width | No | solid/shape: width in px. Defaults to comp width. | |
| height | No | solid/shape: height in px. Defaults to comp height. | |
| source | No | footage layers: project item name or id (from ae_project_info). | |
| threeD | No | Enable 3D for this layer. | |
| boxText | No | text layers: [width, height] to create a paragraph text box instead of point text. | |
| duration | No | Seconds; trims the layer's out point. | |
| fontSize | No | text layers: point size. Default: 72. | |
| position | No | [x, y] or [x, y, z] in comp pixels. | |
| lightType | No | light layers: light type. Default: point. | |
| startTime | No | Seconds to offset the layer's start. | |
| strokeColor | No | shape layers: stroke color. Omit for no stroke. | |
| strokeWidth | No | shape layers: stroke width in px. Default: 0. | |
| cornerRadius | No | shape layers: rounded-rectangle radius. |