Skip to main content

insert_time_key

Function insert_time_key 

Source
pub fn insert_time_key(
    curve: &mut TimeMap,
    time: MediaTime,
) -> Result<(), CurveError>
Expand description

Adds a keyframe at time, inside the keyed range, to a time curve. The segment it falls in is cut as crate::curves::insert_key cuts a number’s, and the new keyframe holds the source tick the curve shows at time. Between the keyframes the curve then names source times within one tick of those it named, since a keyframe holds a whole tick; handles are f32 offsets, whole ticks up to 2^24 of them. A time with a keyframe changes nothing.

A cubic_bezier segment that turns back inside a part gives that part as a value_bezier.

§Errors

CurveError::NotKeyed for a map that is not a curve, CurveError::OutsideKeys for a time before the first keyframe or after the last, whatever the curve does there, or CurveError::TooManyKeys.