Table of Contents

Class UniGLTFAvImporter

Imports glTF avatars using UniGLTF.

public class UniGLTFAvImporter : IAvImporter
Inheritance
object
UniGLTFAvImporter
Implements

Fields

EnableUpdateWhenOffscreen

Should the avatar's SkinnedMeshRenderers be updated when off-screen?

public bool EnableUpdateWhenOffscreen

Field Value

bool

ImporterContextSettings

Optional importer settings.

public ImporterContextSettings? ImporterContextSettings

Field Value

ImporterContextSettings?

MaterialGenerator

Optional material generator.

public IMaterialDescriptorGenerator? MaterialGenerator

Field Value

IMaterialDescriptorGenerator?

ShowMeshes

Should all mesh renderers be enabled on load? (default: true)

public bool ShowMeshes

Field Value

bool

TextureDeserializer

Optional texture deserialization.

public ITextureDeserializer? TextureDeserializer

Field Value

ITextureDeserializer?

Methods

ImportAvatarAsync(AvSourceData, bool, CancellationToken)

Tries to import the avatar into a scene as a disabled GameObject, along with metadata and any renders.

public Awaitable<LoadedAv?> ImportAvatarAsync(AvSourceData rawData, bool throwOnFail, CancellationToken token = default)

Parameters

rawData AvSourceData

The raw avatar data to process.

throwOnFail bool

Should this method throw errors on failures or log them as warnings and return null?

token CancellationToken

Returns

Awaitable<LoadedAv>

The loaded avatar if successful; null on failure.

Remarks

The returned LoadedAv may contain code to handle requirements of format-supporting plugins. For example, GLTFastAvImporter depends on glTFast, which requires that GltfImport object used to import the avatar be active alongside the avatar's GameObject, and should be disposed after the avatar is no longer needed. Thus, LoadedAv implements System.IDisposable.

SupportsFormat(AvModelFileExtension)

Returns true if this importer can handle the given format; false otherwise.

public bool SupportsFormat(AvModelFileExtension format)

Parameters

format AvModelFileExtension

Returns

bool