Skip to main content

Expression

Struct Expression 

Source
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

Source

pub fn new(name: impl Into<String>) -> Self

Creates an empty, continuous expression with the given name.

Source

pub fn name(&self) -> &str

Returns the preset or custom expression name.

Source

pub fn with_morph_target_binds(self, binds: Vec<MorphTargetBind>) -> Self

Replaces the morph targets driven by this expression.

Source

pub fn with_binary(self, is_binary: bool) -> Self

Configures VRM binary thresholding for this expression.

Sets how this expression affects procedural blink expressions.

Source

pub fn with_override_mouth(self, value: ExpressionOverrideType) -> Self

Sets how this expression affects procedural mouth expressions.

Source

pub fn with_override_look_at(self, value: ExpressionOverrideType) -> Self

Sets how this expression affects procedural look-at expressions.

Source

pub fn with_material_color_binds(self, binds: Vec<MaterialColorBind>) -> Self

Replaces the material colors driven by this expression.

Source

pub fn with_texture_transform_binds( self, binds: Vec<TextureTransformBind>, ) -> Self

Replaces the texture transforms driven by this expression.

Source

pub fn is_binary(&self) -> bool

Reports whether input is thresholded to zero or one at 0.5.

Returns the procedural blink override behavior.

Source

pub fn override_mouth(&self) -> ExpressionOverrideType

Returns the procedural mouth override behavior.

Source

pub fn override_look_at(&self) -> ExpressionOverrideType

Returns the procedural look-at override behavior.

Source

pub fn morph_target_binds(&self) -> &[MorphTargetBind]

Returns the morph target binds in declaration order.

Source

pub fn material_color_binds(&self) -> &[MaterialColorBind]

Returns the material color binds in declaration order.

Source

pub fn texture_transform_binds(&self) -> &[TextureTransformBind]

Returns the texture transform binds in declaration order.

Source

pub fn evaluate(&self, input_weight: f32) -> ExpressionEvaluation

Evaluates all binds after clamping or binary-thresholding input_weight.

Trait Implementations§

Source§

impl Clone for Expression

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Expression

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.