Add shape to shape layer
add_shapeAdds parametric rectangles, ellipses, stars, polygons, or bezier paths to an After Effects shape layer, returning group and property paths for follow-up edits.
Instructions
Add a parametric rectangle, ellipse, star or polygon, or a free-form bezier path, to a shape layer. The shape gets its own Vector Group (path + stroke + fill; stroke drawn above fill). Default fill is white unless only a stroke is given. Returns groupPath (use with add_fill/add_stroke/add_shape_modifier/set_shape_path) and the AE propertyPath for generic property tools.
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": {
"layer": "<layer>",
"type": "<type>"
},
"name": "add_shape"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Composition name, 'Folder/Name' path, or item id. Omit to use the active composition. | |
| fill | No | Fill color. Default: white when no stroke is given; no fill when only a stroke is given. false/'none' = no fill. | |
| size | No | rect/ellipse: [w,h] or number px (default 100). star/polygon: diameter when outerRadius is omitted. | |
| type | Yes | Shape kind. | |
| layer | Yes | Layer: 1-based index, layer name, or {id}/{index}/{name}. 'selected' = first selected layer. | |
| closed | No | Closed path (default true). | |
| dashes | No | Stroke dash pattern [dash, gap, dash, gap, ...] px (max 6 values). | |
| points | No | star/polygon: number of points/sides (default 5 star, 6 polygon). | |
| stroke | No | Stroke color (omit for no stroke). | |
| lineCap | No | Stroke line cap. | |
| fillRule | No | Fill rule for overlapping paths / holes (default nonzero). | |
| lineJoin | No | Stroke line join. | |
| position | No | Center of the shape in layer coordinates relative to the layer origin (stored as the group's Transform Position). Default [0,0]. | |
| rotation | No | star/polygon rotation in degrees. | |
| vertices | No | Path points [[x,y],...] (type 'path'). Coordinates relative to the group origin. | |
| groupName | No | Name of the new Vector Group (default: the type, made unique, e.g. 'Rect 2'). | |
| groupPath | No | Existing group to add the new shape group INTO (default: Contents root). | |
| roundness | No | rect: corner radius px. polygon/star: outer roundness %. | |
| inTangents | No | Incoming bezier handles per vertex, RELATIVE to each vertex. Default all [0,0] (straight lines). | |
| fillOpacity | No | Fill opacity 0-100. | |
| innerRadius | No | star inner radius px (default outerRadius/2). | |
| outTangents | No | Outgoing bezier handles per vertex, relative to each vertex. Default all [0,0]. | |
| outerRadius | No | star/polygon outer radius px (default size/2 or 50). | |
| strokeWidth | No | Stroke width px (default 2). | |
| groupOpacity | No | Opacity of the whole group 0-100. | |
| groupRotation | No | Rotation of the whole group in degrees (group Transform). | |
| strokeOpacity | No | Stroke opacity 0-100. | |
| innerRoundness | No | star inner roundness %. | |
| outerRoundness | No | star/polygon outer roundness %. |