# editor.compose.mask.set

Source: https://docs.lightair.app/developers/remote-api/editor.compose.mask.set

> Changes a mask on a picture clip.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Editor. Script plugins need the `project.write` permission.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `clip` | `string` | yes | The clip's id, from editor.timeline.get. |
| `mask` | `number | string` | yes | Its number from 1, or its id. |
| `x` | `number` | no | Its centre across, a fraction of the picture. |
| `y` | `number` | no | Its centre down. |
| `w` | `number` | no | Its width, 0.01 to 4. |
| `h` | `number` | no | Its height, 0.01 to 4. |
| `rotation` | `number` | no | Degrees. |
| `feather` | `number` | no | 0 to 1. |
| `opacity` | `number` | no | 0 to 1. |
| `radius` | `number` | no | A rectangle's corners, 0 to 0.5. |
| `invert` | `boolean` | no | Invert it. |
| `mode` | `string` | no | `add`, `subtract` or `intersect`. |
| `canvas` | `string` | no | A canvas's id or name, shown first. Default: the canvas shown. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `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][] }[]` | no | The clip's masks, numbered from 1. |

## Errors

Not found (-32004) when the clip has no such mask. Invalid params (-32602) for a value out of range. 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

- `editor.changed`

## From an AI agent

The MCP server's `editor_compose (action: mask_set)` reaches this method.

## Related

- [editor.compose.mask.add](https://docs.lightair.app/developers/remote-api/editor.compose.mask.add.md)
