Table of Contents

Class GLTFastAvImporter

Imports glTF avatars using glTFast.

public class GLTFastAvImporter : IAvImporter
Inheritance
object
GLTFastAvImporter
Implements

Fields

DeferAgent

Optional custom glTFast defer agent.

public IDeferAgent? DeferAgent

Field Value

IDeferAgent?

DownloadProvider

Optional custom glTFast download provider.

public IDownloadProvider? DownloadProvider

Field Value

IDownloadProvider?

ImportSettings

Optional custom glTFast ImportSettings.

public ImportSettings? ImportSettings

Field Value

ImportSettings?

InstantiationSettings

Optional custom glTFast InstantiationSettings.

public InstantiationSettings? InstantiationSettings

Field Value

InstantiationSettings?

InstantiatorFactory

Optional factory for custom glTFast GameObjectInstantiators.

public Func<GltfImport, GameObject, Awaitable<GameObjectInstantiator>>? InstantiatorFactory

Field Value

Func<GltfImport, GameObject, Awaitable<GameObjectInstantiator>>

Logger

Optional custom glTFast logger.

public ICodeLogger? Logger

Field Value

ICodeLogger?

MaterialGenerator

Optional custom glTFast material generator.

public IMaterialGenerator? MaterialGenerator

Field Value

IMaterialGenerator?

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