pub struct ParamClip {
pub name: String,
pub tracks: Vec<ParamTrack>,
pub fps: f32,
}Expand description
A full animation clip: multiple tracks for multiple parameters.
Fields§
§name: StringHuman-readable clip name.
tracks: Vec<ParamTrack>All tracks in this clip.
fps: f32Intended frames per second.
Implementations§
Source§impl ParamClip
impl ParamClip
Sourcepub fn add_track(&mut self, track: ParamTrack)
pub fn add_track(&mut self, track: ParamTrack)
Add a track to the clip.
Sourcepub fn find_track(&self, param: &str) -> Option<&ParamTrack>
pub fn find_track(&self, param: &str) -> Option<&ParamTrack>
Find the first track whose param_name matches param.
Sourcepub fn track_count(&self) -> usize
pub fn track_count(&self) -> usize
Number of tracks.
Sourcepub fn evaluate_all(&self, t: f32) -> HashMap<String, f32>
pub fn evaluate_all(&self, t: f32) -> HashMap<String, f32>
Evaluate all tracks at time t, returning a HashMap of param_name → value.
Sourcepub fn bake_all(&self, fps: f32) -> Vec<HashMap<String, f32>>
pub fn bake_all(&self, fps: f32) -> Vec<HashMap<String, f32>>
Bake all tracks to a list of frames at the given fps.
Each frame is a HashMap<param_name, value>.
Sourcepub fn scale_time(&mut self, factor: f32)
pub fn scale_time(&mut self, factor: f32)
Scale all keyframe times by factor.
Sourcepub fn shift_time(&mut self, offset: f32)
pub fn shift_time(&mut self, offset: f32)
Shift all keyframe times by offset.
Auto Trait Implementations§
impl Freeze for ParamClip
impl RefUnwindSafe for ParamClip
impl Send for ParamClip
impl Sync for ParamClip
impl Unpin for ParamClip
impl UnsafeUnpin for ParamClip
impl UnwindSafe for ParamClip
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more