add_mask
Creates a mask on an After Effects layer from a rectangle, ellipse, or custom vertices, with optional feather, expansion, opacity, and mode to control layer visibility.
Instructions
Create a mask on a layer. mode maps to MaskMode (add/subtract/intersect/difference/none; default add). shape is optional: an explicit {vertices,inTangents,outTangents,closed} OR a primitive {rect:[x,y,w,h]} / {ellipse:[x,y,w,h]} with a top-left origin (a 4-point rect or a 4-anchor bezier ellipse is generated). feather ([x,y] or a single number), expansion (px), and opacity (0-100) are optional. Returns {mask,index,mode,closed}.
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>"
},
"name": "add_mask"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Comp: name, numeric id, or { id: N } for duplicate-name-safe stable-id addressing. | |
| mode | No | ||
| name | No | ||
| layer | Yes | Layer: name (string), 1-based index (integer), or { id: N } for duplicate-name-safe stable-id addressing. | |
| shape | No | Explicit vertices/tangents OR a rect/ellipse primitive. | |
| feather | No | Mask feather: a number (applied to x and y) or [x,y]. | |
| opacity | No | ||
| 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. | |
| expansion | No | Mask expansion in px. |