Table of Contents

Interface IAvImporter

Namespace
Uralstech.AvLoader

Interface for an avatar importer.

public interface IAvImporter

Remarks

The role of the IAvImporter is to parse data returned by an IAvDataLoader and bring the avatar into Unity-space as a GameObject. Like IAvDataLoaders, they can be chained up to create fallbacks, for example, a GLTFastAvImporter for glTF support, falling back to one for .fbx support, etc.

Methods

ImportAvatarAsync(AvSourceData, bool, CancellationToken)

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

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.

bool SupportsFormat(AvModelFileExtension format)

Parameters

format AvModelFileExtension

Returns

bool