Add shape
ae_add_shapeDraws rectangles, ellipses, polygons, stars, or custom paths with fill or stroke as a new shape group in After Effects, either on a new layer or an existing shape layer.
Instructions
Draw a shape (rectangle, ellipse, polygon, star, or custom path) with fill and/or stroke, as a new shape group on a new shape layer or added to an existing shape layer (its other groups are kept). Positions are relative to the layer (new layers are centered in the comp, so [0,0] is the comp center). Returns the layer and the new group. To cut out part of a layer use ae_add_mask (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. | |
| fill | No | Fill color; omit for no fill (unless no stroke either: defaults to white). | |
| name | No | Name of the new shape group, and of a new layer (default "Shape Layer"). | |
| size | No | [w,h] in pixels for rectangle/ellipse (default [400,400]); polygon/star radii default from its width. | |
| layer | No | Existing shape layer to add to (other layer types fail); omit to create a new one. | |
| shape | Yes | ||
| closed | No | For 'path': close the path (default true). | |
| points | No | Polygon/star: number of points (default 5). | |
| stroke | No | Stroke color; omit for no stroke. | |
| position | No | Shape center within the layer (default [0,0]); not used for 'path'. | |
| vertices | No | For 'path' (required): points [[x,y],...] in layer coordinates. | |
| roundness | No | Rectangle corner roundness in pixels (default 0). | |
| inTangents | No | For 'path': incoming Bezier handle per vertex, [[x,y],...] relative to the vertex (default: straight segments). | |
| innerRadius | No | Star: inner radius in pixels (default size[0]/4). | |
| outTangents | No | For 'path': outgoing Bezier handle per vertex, relative to the vertex. | |
| outerRadius | No | Polygon/star: outer radius in pixels (default size[0]/2). | |
| strokeWidth | No | Stroke width in pixels (default 4); only with stroke. |