pub struct AvatarAssetBuilder { /* private fields */ }Expand description
Builds a programmatic avatar and validates it before it becomes immutable.
Implementations§
Source§impl AvatarAssetBuilder
impl AvatarAssetBuilder
Sourcepub fn new() -> Self
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.
Sourcepub fn with_meta(self, meta: AvatarMeta) -> Self
pub fn with_meta(self, meta: AvatarMeta) -> Self
Replaces the required VRM metadata.
Sourcepub fn with_humanoid(self, humanoid: Humanoid) -> Self
pub fn with_humanoid(self, humanoid: Humanoid) -> Self
Replaces the humanoid bone-to-node mapping.
Sourcepub fn with_expressions(self, expressions: Expressions) -> Self
pub fn with_expressions(self, expressions: Expressions) -> Self
Replaces the preset and custom expression registry.
Sourcepub fn with_nodes(self, nodes: Vec<AvatarNode>) -> Self
pub fn with_nodes(self, nodes: Vec<AvatarNode>) -> Self
Replaces the complete node hierarchy addressed by crate::NodeId.
Sourcepub fn with_primitives(self, primitives: Vec<RenderPrimitive>) -> Self
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.
Sourcepub fn with_images(self, images: Vec<AvatarImage>) -> Self
pub fn with_images(self, images: Vec<AvatarImage>) -> Self
Replaces the encoded image list addressed by crate::ImageId.
Sourcepub fn with_materials(self, materials: Vec<Material>) -> Self
pub fn with_materials(self, materials: Vec<Material>) -> Self
Replaces the material list addressed by crate::MaterialId.
Sourcepub fn with_textures(self, textures: Vec<AvatarTexture>) -> Self
pub fn with_textures(self, textures: Vec<AvatarTexture>) -> Self
Replaces the texture list addressed by crate::TextureId.
Sourcepub fn with_skins(self, skins: Vec<Skin>) -> Self
pub fn with_skins(self, skins: Vec<Skin>) -> Self
Replaces the skin list addressed by crate::SkinId.
Sourcepub fn with_look_at(self, look_at: LookAt) -> Self
pub fn with_look_at(self, look_at: LookAt) -> Self
Adds the avatar’s optional LookAt configuration.
Sourcepub fn with_first_person(self, first_person: FirstPerson) -> Self
pub fn with_first_person(self, first_person: FirstPerson) -> Self
Replaces the first-person mesh visibility configuration.
Sourcepub fn with_constraints(self, constraints: Vec<NodeConstraint>) -> Self
pub fn with_constraints(self, constraints: Vec<NodeConstraint>) -> Self
Replaces the node-constraint list.
Sourcepub fn with_spring_bone(self, spring_bone: SpringBone) -> Self
pub fn with_spring_bone(self, spring_bone: SpringBone) -> Self
Replaces the SpringBone collider and chain configuration.
Sourcepub fn build(self) -> Result<AvatarAsset, BuildError>
pub fn build(self) -> Result<AvatarAsset, BuildError>
Validates all object references and VRM invariants, then freezes the asset.