Table of Contents

Class LoadedUniVRM10Av

A loaded UniVRM VRM10 avatar.

public class LoadedUniVRM10Av : LoadedAv, IImportedAnimator, ILookAtProvider, IAvatarExpressionProvider, IBlendShapeProviderBulk, IBlendShapeProvider, ICapability
Inheritance
object
LoadedUniVRM10Av
Implements
Inherited Members
Extension Methods

Constructors

LoadedUniVRM10Av(GameObject, Vrm10Instance, AvMetadata, Texture2D?, Texture2D?, Type)

public LoadedUniVRM10Av(GameObject gameObject, Vrm10Instance vrmInstance, AvMetadata metadata, Texture2D? fullRender, Texture2D? bustRender, Type importerType)

Parameters

gameObject GameObject
vrmInstance Vrm10Instance
metadata AvMetadata
fullRender Texture2D?
bustRender Texture2D?
importerType Type

Fields

GLTFInstance

The RuntimeGltfInstance component of the VRM avatar, if it exists.

public readonly RuntimeGltfInstance? GLTFInstance

Field Value

RuntimeGltfInstance?

VRMInstance

The VRM avatar.

public readonly Vrm10Instance VRMInstance

Field Value

Vrm10Instance

Properties

Animator

The importer-generated animator.

public Animator Animator { get; }

Property Value

Animator

ChannelNames

Case-sensitive keys for all available blend weights.

public IReadOnlyCollection<string> ChannelNames { get; }

Property Value

IReadOnlyCollection<string>

HasWeights

Does this avatar have any blendshape weights?

public bool HasWeights { get; }

Property Value

bool

Methods

ClearTarget()

Clears the look-at target.

public void ClearTarget()

Remarks

Implementations should reset the avatar to its default gaze.

GetWeight(string)

Gets the weight for the given name.

public float GetWeight(string name)

Parameters

name string

Returns

float

Remarks

If multiple blend shape sources in the avatar have the same channel name, this gets the maximum weight.

GetWeights(ReadOnlySpan<string>, Span<float>)

Retrieves the weights of the specified blendshape channels into the provided buffer.

public void GetWeights(ReadOnlySpan<string> names, Span<float> weights)

Parameters

names ReadOnlySpan<string>
weights Span<float>

Remarks

For channel names that do not exist, the corresponding output value is set to zero.

HasWeight(string)

Checks if a weight channel with the given name exists.

public bool HasWeight(string name)

Parameters

name string

Returns

bool

ImporterSpecificDispose()

protected override void ImporterSpecificDispose()

SetTarget(Transform)

Sets a transform for the avatar to look at.

public void SetTarget(Transform transform)

Parameters

transform Transform

Remarks

Implementations should track the transform over time.

SetTarget(Vector3)

Sets a fixed world-space position for the avatar to look at.

public void SetTarget(Vector3 worldPosition)

Parameters

worldPosition Vector3

SetWeight(string, float)

Sets the weight for the given name.

public void SetWeight(string name, float weight)

Parameters

name string
weight float

Remarks

If multiple blend shape sources in the avatar have the same channel name, this sets the weight for all of them.

SetWeights(ReadOnlySpan<string>, ReadOnlySpan<float>)

Sets the weights of the specified blendshape channels.

public int SetWeights(ReadOnlySpan<string> names, ReadOnlySpan<float> weights)

Parameters

names ReadOnlySpan<string>
weights ReadOnlySpan<float>

Returns

int

The number of weights successfully applied.

Remarks

Channel names that do not exist are ignored; the return value indicates how many weights were applied.

SetWeights(ReadOnlySpan<(string name, float weight)>)

Sets multiple blendshape weights using name–value pairs.

public int SetWeights(ReadOnlySpan<(string name, float weight)> values)

Parameters

values ReadOnlySpan<(string name, float weight)>

Returns

int

The number of weights successfully applied.

Remarks

Channel names that do not exist are ignored; the return value indicates how many weights were applied.

TryGetAvatarMaterials()

Tries to get all materials of the avatar.

public override IReadOnlyList<Material>? TryGetAvatarMaterials()

Returns

IReadOnlyList<Material>

TryGetAvatarMeshes()

Tries to get all meshes of the avatar.

public override IReadOnlyList<Mesh>? TryGetAvatarMeshes()

Returns

IReadOnlyList<Mesh>

TryGetAvatarRenderers()

Tries to get all renderers of the avatar.

public override IReadOnlyList<Renderer>? TryGetAvatarRenderers()

Returns

IReadOnlyList<Renderer>