Expand description
What an editor needs of a keyed number besides its value: control points to draw, speed, range, and edits that keep the curve it already shows.
Structs§
- Control
Segment - One segment in (ticks, value): its two ends and, for a Bezier kind, its two control points.
- Curve
Sample - A keyed number at one time.
Enums§
- Auto
Tangent - How
auto_tangentschooses the slope at a keyframe. - Curve
Error - Why a curve service did not do what was asked.
- Segment
Kind - What draws a segment.
Functions§
- auto_
tangents - Writes value-curve handles at the chosen keyframes (every keyframe when
keysisNone) from their neighbours. Each segment beside a chosen keyframe becomes an unweighted value curve (a cubic Hermite curve) that keeps the slope at its other end; held segments are left alone. A keyframe beside a held segment or at an end takes the slope of its one moving side. - contain
curvewith each handle whose time coordinate lies outside0..=1shortened along its own direction until it lies on that edge: time and value are scaled alike, and a handle that points backwards in time collapses onto its keyframe. The result never runs backwards.- from_
handle_ points - The value curve whose four control points are given in (time, value), as Blender and Maya
store weighted handles. Handles that reach past the other key give time coordinates outside
what the engine takes; pass the result through
contain. - from_
slopes - The Hermite value curve of a segment
secondslong that leaves at slopeleaveand arrives at slopearrive, both in value per second (glTF cubic spline tangents, unweighted tangents of Unity, Unreal and Maya). - from_
speed_ influence - The value curve of a segment
secondslong whose ends have these(speed, influence)pairs, as After Effects shows them: speed in value per second, influence in percent of the segment’s length. - insert_
eased_ key - Adds a keyframe holding
valueattimeto a value that has no value axis (a colour, a paint, a path), cutting the segment’s timing curve so both parts keep their shape.valueis the caller’s sample of the animation attime. - insert_
key - Adds a keyframe at
timewithout changing the curve: the segment it falls in is cut by de Casteljau subdivision and the new keyframe takes the curve’s value there, rounded tof32. Astepssegment becomes held keyframes, one where each value starts, and apointssegment two tables, or straight lines between keyframes where a part ends level. - insert_
point_ key - Adds a keyframe at
timeto a position without changing its path or its speed along it: the timing curve is cut as byinsert_eased_keyand the spatial curve where that much of its arc length lies, measured in a spaceaspectwide per unit high. - materialize
- Spells out as keyframes what the value’s
beforeandaftershow overrange, and sets each side the range reaches tohold: copies of the keyframes for every pass of a repeating mode that meets the range, and one keyframe at the range’s edge forlinear. - path_
to_ keys - The position keyframes that show what the
pathpositionmotionshows overrange, with lengths measured in a spaceaspectwide per unit high: the same path at the same speed. - range
- The least and greatest value of a number over
range, overshoot between keyframes included, with its extrapolation. - sample
- The value and velocity of a number at each of
times, with its extrapolation. On a keyframe, at a wrap and at a turn ofping_pongthe velocity is the one the curve arrives with. A value that is not keyed has no velocity. - segments
- The segments of a keyed number, for drawing its curve and handles. Empty for a value that is not keyed.
- to_
timing_ curves - Rewrites every value curve of a keyed number as the timing curve that draws the same line.
- to_
value_ curves - Rewrites every timing curve and straight line of a keyed number as the value curve that draws the same line. Held, stepped and table segments stay.