Interface IAvImporter
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
rawDataAvSourceDataThe raw avatar data to process.
throwOnFailboolShould this method throw errors on failures or log them as warnings and return null?
tokenCancellationToken
Returns
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)
bool SupportsFormat(AvModelFileExtension format)
Parameters
formatAvModelFileExtension
Returns
- bool