Skip to main content

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

ParamTypeDescription
outKeyframekeyframe to be added at the point of subdivision, its tangents, time and value will be overwritten
key0Keyframestart of the segment
key1Keyframeend of the segment
tnumbernormalized 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);