set_keyframe
Insert or update a keyframe on a layer parameter at a given timeline time. Snaps to the frame, updates existing keys in place, and handles numeric, color, and effect values with easing.
Instructions
Insert or update one key on a layer param by time (t_us, timeline-absolute), snapped to the frame first: a key on that frame is updated in place, id kept. On a Static track the first key replaces the static value, which is not kept — key the start value too, or use set_param_track. value is typed by param_key: a number, or {r,g,b,a} (0..255) for "color"; an effect param needs no prior write and must sit in its catalog range. easing eases the segment leaving the key, or on the last key the one arriving at it; omitted, a new key inherits the easing of the segment it splits. Returns the key (keyframe_id, t_us, local_t_us). Sides, continuity, Auto tangents: update_keyframe.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"layer_id": "<layer_id>",
"param_key": "<param_key>",
"t_us": "<t_us>",
"value": "<value>"
},
"name": "set_keyframe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| t_us | Yes | Key time, timeline-absolute, µs. | |
| value | Yes | Typed by `param_key`: a number for scalar params (x, y, path_progress, scale_x, scale_y, rotation_deg, anchor_x, anchor_y, opacity, gain_db, pan, effect params), {r,g,b,a} (0..255) for "color". Path mode takes path_progress (a fraction) instead of x/y. | |
| easing | No | Easing of the segment leaving the key (on the last key, the one arriving at it): {"preset":"<id>"} or a raw {"kind":...}. Writes this key's out/segment and the next key's in. | |
| layer_id | Yes | Layer id. | |
| param_key | Yes | Visual: x/y (XY), path_progress (Path), scale_x, scale_y, rotation_deg, anchor_x, anchor_y, opacity; Text/Color: color; Audio: gain_db, pan; effects[<effect_id>].params[<key>]. |