editor.compose.mask.add
Adds a rectangle, ellipse or path mask to a picture clip.
JSON-RPC 2.0project.write
Parameters
- clipstringrequiredThe clip's id, from editor.timeline.get.
- shapestringrequired
rectangle,ellipseorpath. - points[number, number][]A path's points: three or more, fractions of its box.
- xnumberIts centre across, a fraction of the picture.
- ynumberIts centre down.
- wnumberIts width, 0.01 to 4.
- hnumberIts height, 0.01 to 4.
- rotationnumberDegrees.
- feathernumber0 to 1.
- opacitynumber0 to 1.
- radiusnumberA rectangle's corners, 0 to 0.5.
- invertbooleanInvert it.
- modestring
add,subtractorintersect. - canvasstringA canvas's id or name, shown first. Default: the canvas shown.
Result
- masks{ mask: number, id: string, shape: string, x: number, y: number, w: number, h: number, rotation: number, feather: number, opacity: number, invert: boolean, mode: string, radius?: number, points?: [number, number][] }[]The clip's masks, numbered from 1.
Errors
Invalid params (-32602) for an unknown shape, a path with fewer than three points, a value out of range, or a sound clip. A state error (-32005) when no Editor project is open, or the open one is read-only because a newer Lightair made it. Invalid params (-32602) for a clip id that can't be read; not found (-32004) for a clip that isn't on the canvas.
Events
Subscribers to events get editor.changed.
From an AI agent
The MCP server's editor_compose (action: mask_add) reaches this method.
Example
{ "jsonrpc": "2.0", "id": 1, "method": "editor.compose.mask.add", "params": {}}lightair call editor.compose.mask.addconst result = lightair.call("editor.compose.mask.add", {});