set_keyframe
Insert or update a keyframe on a layer parameter at a specific timeline time, with typed values and easing control. Animate position, scale, opacity, color, audio, or effect params.
Instructions
Insert or update a keyframe on a layer param; t_us is timeline-absolute. A Static track is lifted to Keyframed; a key at the same frame is updated in place. Returns the key (keyframe_id, t_us). value is typed by param_key: a number for scalars, {r,g,b,a} (0..255) for "color"; an effect param must sit in its catalogued range (effects://catalog). interp (optional) eases the segment LEAVING this key (Hold | Linear | Bezier {p1,p2} | Elastic | Bounce); omitted, it inherits the preceding segment's. A Bezier on the LAST key is refused — its p2 lands on the next key, so add that key first. One side, the continuity or a preset: update_keyframe; Auto tangents: smooth_keyframes.
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. | |
| interp | No | Easing: {"kind":"Hold"} | {"kind":"Linear"} | {"kind":"Bezier","p1":[x,y],"p2":[x,y]} | {"kind":"Elastic","dir",amplitude?,period?} | {"kind":"Bounce","dir"}. | |
| layer_id | Yes | Layer id. | |
| param_key | Yes | Animatable param: visual kinds x, y (path_progress in Path mode), scale_x, scale_y, rotation_deg, anchor_x, anchor_y, opacity; Text and Color color; Audio gain_db, pan; or an effect param as effects[<effect_id>].params[<key>]. |