Skip to main content

AvatarAssetBuilder

Struct AvatarAssetBuilder 

Source
pub struct AvatarAssetBuilder { /* private fields */ }
Expand description

Builds a programmatic avatar and validates it before it becomes immutable.

Implementations§

Source§

impl AvatarAssetBuilder

Source

pub fn new() -> Self

Creates an empty asset builder.

Self::build requires complete VRM metadata, a valid humanoid, and the corresponding node hierarchy before it can succeed.

Source

pub fn with_meta(self, meta: AvatarMeta) -> Self

Replaces the required VRM metadata.

Source

pub fn with_humanoid(self, humanoid: Humanoid) -> Self

Replaces the humanoid bone-to-node mapping.

Source

pub fn with_expressions(self, expressions: Expressions) -> Self

Replaces the preset and custom expression registry.

Source

pub fn with_nodes(self, nodes: Vec<AvatarNode>) -> Self

Replaces the complete node hierarchy addressed by crate::NodeId.

Source

pub fn with_primitives(self, primitives: Vec<RenderPrimitive>) -> Self

Replaces the renderer-ready primitive list.

Use crate::RenderPrimitiveBuilder to construct each primitive without exposing storage indices or partially initialized buffers.

Source

pub fn with_images(self, images: Vec<AvatarImage>) -> Self

Replaces the encoded image list addressed by crate::ImageId.

Source

pub fn with_materials(self, materials: Vec<Material>) -> Self

Replaces the material list addressed by crate::MaterialId.

Source

pub fn with_textures(self, textures: Vec<AvatarTexture>) -> Self

Replaces the texture list addressed by crate::TextureId.

Source

pub fn with_skins(self, skins: Vec<Skin>) -> Self

Replaces the skin list addressed by crate::SkinId.

Source

pub fn with_look_at(self, look_at: LookAt) -> Self

Adds the avatar’s optional LookAt configuration.

Source

pub fn with_first_person(self, first_person: FirstPerson) -> Self

Replaces the first-person mesh visibility configuration.

Source

pub fn with_constraints(self, constraints: Vec<NodeConstraint>) -> Self

Replaces the node-constraint list.

Source

pub fn with_spring_bone(self, spring_bone: SpringBone) -> Self

Replaces the SpringBone collider and chain configuration.

Source

pub fn build(self) -> Result<AvatarAsset, BuildError>

Validates all object references and VRM invariants, then freezes the asset.

Trait Implementations§

Source§

impl Debug for AvatarAssetBuilder

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for AvatarAssetBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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.