Set matte source
set_matte_sourceSet (or clear) a track matte — the host shows only where the matte source is opaque. The HOST can be a leaf (image., video., shapes., text.) OR a group. (a group is a layer of sorts): a group host clips ALL its composited children to the source shape's path — e.g. a marching chevron strip + black backing shown only inside an arrow / band shape. For a leaf host the source can be any leaf (use a text. source for video-/image-filled letterforms); for a group host the source must be a shape (shapes.). The source is CONSUMED: it stops painting as a layer of its own, so do NOT hide it or set its opacity to 0 (an invisible stencil empties the mask and the host vanishes). It has no time window of its own: it follows the host's, and attaching drops its block and edge transitions (source_window_dropped in the result). Its position, scale, rotation and keyframes shape the mask. Pass null to clear.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementId | Yes | Host being masked: image/video/shapes/text.<id>, or group.<id>. | |
| projectId | Yes | Opaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates. | |
| matte_inverted | No | Optional. Invert the mask (knock-out): the host shows everywhere EXCEPT where the source is opaque — a punch-through / spotlight. Honored on leaf hosts; ignored on group hosts. Omitted = preserve current; clearing the mask resets it. | |
| matte_source_id | Yes | Element id of the layer whose alpha drives the mask, or null to clear. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the call succeeded. | |
| data | No | The payload, shaped by the tool. | |
| note | No | What to do next when not ready. | |
| error | No | Why it failed. | |
| status | No | For cache-backed readers: whether the answer was ready. | |
| editorUrl | No | Opens this project in the editor. |