# editor.clip.set

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

> Changes a clip: volume, speed, place, size, rotation, opacity, fades, text, ducking, crop, flips, corners, border, tilt or grade.

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

Everything is checked first, then done as one undo step. A `speed` goes on the clip's linked clips too, and replaces a speed ramp.

- `crop`: [left, top, right, bottom], each 0 to 0.9 of the picture, leaving some.
- `radius`: its corners' rounding, 0 to 0.5 of its short side.
- `border`: `{color: "#RRGGBB", width}` (0.5 to 200 pixels, 8 by default), or null.
- `tilt`: [around the horizontal axis, around the vertical], −89 to 89 degrees.
- `grade`: `{lift, gamma, gain: {r, g, b, master}, curves: {master, red, green, blue: [[x, y], …]}}`, or null.

Crop, corners, border and flips are for pictures only.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `clip` | `string` | yes | The clip's id, from editor.timeline.get. |
| `volume` | `number` | no | 0 to 4. |
| `muted` | `boolean` | no | Muted. |
| `speed` | `number` | no | 0.1 to 16. |
| `x` | `number` | no | Its place across. |
| `y` | `number` | no | Its place down. |
| `scale` | `number` | no | 0.05 to 10. |
| `rotation` | `number` | no | Degrees. |
| `opacity` | `number` | no | 0 to 1. |
| `fade_in_ms` | `number` | no | At most half its length. |
| `fade_out_ms` | `number` | no | At most half its length. |
| `text` | `string` | no | A title's words. |
| `duck` | `boolean` | no | Turn it down under voices. |
| `crop` | `[number, number, number, number]` | no | See above. |
| `flip_h` | `boolean` | no | Flip it across. |
| `flip_v` | `boolean` | no | Flip it upside down. |
| `radius` | `number` | no | See above. |
| `border` | `{ color: string, width?: number } | null` | no | See above. |
| `tilt` | `[number, number]` | no | See above. |
| `grade` | `object | null` | no | See above. |
| `canvas` | `string` | no | A canvas's id or name, shown first. Default: the canvas shown. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `(the clip)` | `{ id: string, name: string, track: number, start_ms: number, end_ms: number, in_ms: number, out_ms: number, speed: number, volume: number, muted: boolean, media: string | null, text: string | null }` | no | The clip as editor.timeline.get lists it. |

## Errors

Invalid params (-32602) for a value out of range, or a picture setting on a sound clip. A state error (-32005) when a slower speed would run into the next 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

- `editor.changed`

## From an AI agent

The MCP server's `editor_clip (action: set)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "editor.clip.set", "params": { "clip": "019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d", "volume": 0.5, "fade_in_ms": 500 } }
```

Result:

```json
{ "id": "019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d", "name": "intro", "track": 0, "start_ms": 0, "end_ms": 12000, "in_ms": 0, "out_ms": 12000, "speed": 1, "volume": 0.5, "muted": false, "media": "019ad3f6-6f70-7182-9394-0f1a2b3c4d5e", "text": null }
```

## Related

- [editor.clip.key](https://docs.lightair.app/developers/remote-api/editor.clip.key.md)
- [editor.looks.filter](https://docs.lightair.app/developers/remote-api/editor.looks.filter.md)
- [editor.timeline.get](https://docs.lightair.app/developers/remote-api/editor.timeline.get.md)
