add_curve_key
Add or update a keyframe at a given time and value on a curve channel, set interpolation, and save the asset. Existing keys at that time are replaced.
Instructions
Add or update a keyframe (time, value) on one channel of a CurveFloat, CurveVector or CurveLinearColor asset, set its interpolation and save the asset; a key already at that time is replaced. Returns the read-back time, value, interp and key_count. Inverse: remove_curve_key; list keys with get_curve_keys.
Returns: { curve_path, curve_class, channel, num_channels, time, value, interp, key_added, key_count, saved }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| time | Yes | Key time on the X axis of the curve, in the units the curve uses (often seconds); an existing key at this time is replaced | |
| value | Yes | Key value (Y axis) stored at that time on the chosen channel, as a float | |
| interp | No | Key interpolation mode (constant|cubic|linear, default linear); any other value silently falls back to linear | |
| channel | No | Curve channel index, default 0: 0 for CurveFloat, 0-2 (X, Y, Z) for CurveVector, 0-3 (R, G, B, A) for CurveLinearColor; out of range is an error | |
| curve_path | Yes | Full asset path of the curve |