editor.clip.set
Changes a clip: volume, speed, place, size, rotation, opacity, fades, text, ducking, crop, flips, corners, border, tilt or grade.
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
- clipstringrequiredThe clip's id, from editor.timeline.get.
- volumenumber0 to 4.
- mutedbooleanMuted.
- speednumber0.1 to 16.
- xnumberIts place across.
- ynumberIts place down.
- scalenumber0.05 to 10.
- rotationnumberDegrees.
- opacitynumber0 to 1.
- fade_in_msnumberAt most half its length.
- fade_out_msnumberAt most half its length.
- textstringA title's words.
- duckbooleanTurn it down under voices.
- crop[number, number, number, number]See above.
- flip_hbooleanFlip it across.
- flip_vbooleanFlip it upside down.
- radiusnumberSee above.
- border{ color: string, width?: number } | nullSee above.
- tilt[number, number]See above.
- gradeobject | nullSee above.
- canvasstringA canvas's id or name, shown first. Default: the canvas shown.
Result
- (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 }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
Subscribers to events get editor.changed.
From an AI agent
The MCP server's editor_clip (action: set) reaches this method.
Example
{ "jsonrpc": "2.0", "id": 1, "method": "editor.clip.set", "params": { "clip": "019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d", "volume": 0.5, "fade_in_ms": 500 }}lightair call editor.clip.set '{"clip":"019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d","volume":0.5,"fade_in_ms":500}'const result = lightair.call("editor.clip.set", {"clip":"019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d","volume":0.5,"fade_in_ms":500});Result
{ "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 }