pub enum Track<T> {
Const(T),
Keys(Vec<Key<T>>),
Expr(Vec<Compiled>),
KeysExpr(Vec<Key<T>>, Vec<Compiled>),
Sampled(Vec<T>),
}Expand description
A parameter: a constant, keyframes, an expression per component, or an expression over its
own keys (value).
Variants§
Const(T)
Keys(Vec<Key<T>>)
Sorted by t; held before the first and after the last.
Expr(Vec<Compiled>)
One per component.
KeysExpr(Vec<Key<T>>, Vec<Compiled>)
An expression per component over its own keys (value).
Sampled(Vec<T>)
Per frame, from the range’s first frame (internal: exact lowering).
Implementations§
Source§impl<T: Animatable> Track<T>
impl<T: Animatable> Track<T>
Sourcepub fn parse(v: &Value, clock: Clock, what: &str) -> Result<Self>
pub fn parse(v: &Value, clock: Clock, what: &str) -> Result<Self>
A constant, keys, an expression string (N = 1), an array of N constants or
expressions, or {"keys": [...], "expr": ...}. what names the parameter in errors.
Sourcepub fn parse_in(v: &Value, scope: &Scope<'_>, what: &str) -> Result<Self>
pub fn parse_in(v: &Value, scope: &Scope<'_>, what: &str) -> Result<Self>
Track::parse against scope (its clock and vars).
Sourcepub fn from_keys(keys: Vec<Key<T>>) -> Self
pub fn from_keys(keys: Vec<Key<T>>) -> Self
Keys in any order (sorted here, stable for equal times).
Sourcepub fn is_animated(&self) -> bool
pub fn is_animated(&self) -> bool
Whether the value can change from frame to frame.
Sourcepub fn try_eval(&self, clock: Clock, frame: &Frame<'_>) -> Result<Option<T>>
pub fn try_eval(&self, clock: Clock, frame: &Frame<'_>) -> Result<Option<T>>
The value on frame, None for empty keys; an error if an expression isn’t finite.
Sampled reads frame’s n.
Sourcepub fn eval(&self, frame: &Frame<'_>) -> Result<T>
pub fn eval(&self, frame: &Frame<'_>) -> Result<T>
The value on frame, keys on Clock::Layer (lt).