pub enum AnimSource {
Snapshots(Vec<ParamState>),
Curves(HashMap<String, AnimCurve>),
}Expand description
A source of time-varying morph parameters for baking animated frame sequences. See the module docs for the accepted JSON shapes.
Variants§
Snapshots(Vec<ParamState>)
One fully-resolved ParamState per output frame (frame count is fixed).
Curves(HashMap<String, AnimCurve>)
Continuous per-parameter animation curves, keyed by parameter name, sampled at an arbitrary time in seconds.
Implementations§
Source§impl AnimSource
impl AnimSource
Sourcepub fn fixed_frame_count(&self) -> Option<usize>
pub fn fixed_frame_count(&self) -> Option<usize>
The frame count implied by this source, if it is fixed (dense form only).
Sourcepub fn suggested_frame_count(&self, fps: f32) -> usize
pub fn suggested_frame_count(&self, fps: f32) -> usize
A reasonable default frame count for curve sources: enough frames at
fps to cover the longest-running parameter curve, at least one frame.
Sourcepub fn params_at_frame(&self, i: usize, fps: f32, start_time: f32) -> ParamState
pub fn params_at_frame(&self, i: usize, fps: f32, start_time: f32) -> ParamState
Resolve the ParamState to apply for output frame i.
For the dense (snapshot) form, i indexes directly into the array
(clamped to the last entry so callers never index out of range). For
the curve form, each named parameter curve is sampled at
t = start_time + i / fps.
Trait Implementations§
Source§impl Clone for AnimSource
impl Clone for AnimSource
Source§fn clone(&self) -> AnimSource
fn clone(&self) -> AnimSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AnimSource
impl RefUnwindSafe for AnimSource
impl Send for AnimSource
impl Sync for AnimSource
impl Unpin for AnimSource
impl UnsafeUnpin for AnimSource
impl UnwindSafe for AnimSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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