pub struct Expression { /* private fields */ }Expand description
A named, combinable facial/motion expression (e.g. “happy”, “blink”).
Holds the binds it drives and the override rules for the procedural
mouth / blink / gaze categories. is_binary expressions only ever output
0 or 1.
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates an empty, continuous expression with the given name.
Sourcepub fn with_morph_target_binds(self, binds: Vec<MorphTargetBind>) -> Self
pub fn with_morph_target_binds(self, binds: Vec<MorphTargetBind>) -> Self
Replaces the morph targets driven by this expression.
Sourcepub fn with_binary(self, is_binary: bool) -> Self
pub fn with_binary(self, is_binary: bool) -> Self
Configures VRM binary thresholding for this expression.
Sourcepub fn with_override_blink(self, value: ExpressionOverrideType) -> Self
pub fn with_override_blink(self, value: ExpressionOverrideType) -> Self
Sets how this expression affects procedural blink expressions.
Sourcepub fn with_override_mouth(self, value: ExpressionOverrideType) -> Self
pub fn with_override_mouth(self, value: ExpressionOverrideType) -> Self
Sets how this expression affects procedural mouth expressions.
Sourcepub fn with_override_look_at(self, value: ExpressionOverrideType) -> Self
pub fn with_override_look_at(self, value: ExpressionOverrideType) -> Self
Sets how this expression affects procedural look-at expressions.
Sourcepub fn with_material_color_binds(self, binds: Vec<MaterialColorBind>) -> Self
pub fn with_material_color_binds(self, binds: Vec<MaterialColorBind>) -> Self
Replaces the material colors driven by this expression.
Sourcepub fn with_texture_transform_binds(
self,
binds: Vec<TextureTransformBind>,
) -> Self
pub fn with_texture_transform_binds( self, binds: Vec<TextureTransformBind>, ) -> Self
Replaces the texture transforms driven by this expression.
Sourcepub fn override_blink(&self) -> ExpressionOverrideType
pub fn override_blink(&self) -> ExpressionOverrideType
Returns the procedural blink override behavior.
Sourcepub fn override_mouth(&self) -> ExpressionOverrideType
pub fn override_mouth(&self) -> ExpressionOverrideType
Returns the procedural mouth override behavior.
Sourcepub fn override_look_at(&self) -> ExpressionOverrideType
pub fn override_look_at(&self) -> ExpressionOverrideType
Returns the procedural look-at override behavior.
Sourcepub fn morph_target_binds(&self) -> &[MorphTargetBind]
pub fn morph_target_binds(&self) -> &[MorphTargetBind]
Returns the morph target binds in declaration order.
Sourcepub fn material_color_binds(&self) -> &[MaterialColorBind]
pub fn material_color_binds(&self) -> &[MaterialColorBind]
Returns the material color binds in declaration order.
Sourcepub fn texture_transform_binds(&self) -> &[TextureTransformBind]
pub fn texture_transform_binds(&self) -> &[TextureTransformBind]
Returns the texture transform binds in declaration order.
Sourcepub fn evaluate(&self, input_weight: f32) -> ExpressionEvaluation
pub fn evaluate(&self, input_weight: f32) -> ExpressionEvaluation
Evaluates all binds after clamping or binary-thresholding input_weight.