animation_curve_subdivide
animation_curve_subdivide(out, key0, key1, t) ⇒ Keyframe
Subdivide a curve segment by introducing a new keyframe at a given normalized time. Subdivision does not alter the curve shape in any way, it is intended primarily for editing purposes.
Kind: global function
Returns: Keyframe - out, for convenience
See: AnimationCurve
| Param | Type | Description |
|---|---|---|
| out | Keyframe | keyframe to be added at the point of subdivision, its tangents, time and value will be overwritten |
| key0 | Keyframe | start of the segment |
| key1 | Keyframe | end of the segment |
| t | number | normalized time in [0..1] between key0 and key1 where new frame is to be inserted |
Example
const new_frame = animation_curve_subdivide(new Keyframe(), key0, key1, 0.5);
curve.add(new_frame);