Show / Hide Table of Contents

Class ModelLoader

Model load utility

In principle, callback called asynchronously

Anything with Async will be executed asynchronously, success result Task will be returned

Inheritance
Object
ModelLoader
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Pixiv.VroidSdk
Assembly: VRoidSDK.dll
Syntax
public static class ModelLoader

Methods

Initialize(ISdkConfig, IDownloadLicensePublishable, String, UInt32, SynchronizationContext)

Initialize

Declaration
public static void Initialize(ISdkConfig config, IDownloadLicensePublishable downloadApi, string cacheEncryptPassword, uint maxCacheCount = 10U, SynchronizationContext context = null)
Parameters
Type Name Description
ISdkConfig config

VRoid SDK usage settings

IDownloadLicensePublishable downloadApi

Client to request download API

String cacheEncryptPassword

Application-specific arbitrary string to encrypt model data

UInt32 maxCacheCount

Max no. of models to store

SynchronizationContext context

Main thread SynchronizationContext

LoadVrm(CharacterModel, Action<GameObject>, Action<Single>, Action<ModelLoadFailException>, Func<VRMData, VRMImporterContext>)

Load VRM model

Declaration
public static void LoadVrm(CharacterModel characterModel, Action<GameObject> onSuccess, Action<float> onProgress, Action<ModelLoadFailException> onFailed, Func<VRMData, VRMImporterContext> onGenerateVRMImporterContext = null)
Parameters
Type Name Description
CharacterModel characterModel

Model to download

Action<GameObject> onSuccess

Success callback

Action<Single> onProgress

Progress callback

Action<ModelLoadFailException> onFailed

Failure callback

Func<VRMData, VRMImporterContext> onGenerateVRMImporterContext

Use when you want to generate VRMImporterContext from loaded VRM data (optional)

Remarks

Load from cache if cache exists on device Carry out download if cache doe not exist

Exceptions
Type Condition
Exception

Exception thrown when ModelLoader is not initialized

See Also
LoadVrmAsync(CharacterModel, Action<Single>, Func<VRMData, VRMImporterContext>)

LoadVrmAsync(CharacterModel, Action<Single>, Func<VRMData, VRMImporterContext>)

Load VRM model

Declaration
public static async Task<GameObject> LoadVrmAsync(CharacterModel characterModel, Action<float> onProgress, Func<VRMData, VRMImporterContext> onGenerateVRMImporterContext = null)
Parameters
Type Name Description
CharacterModel characterModel

Model to download

Action<Single> onProgress

Progress callback

Func<VRMData, VRMImporterContext> onGenerateVRMImporterContext

Use when you want to generate VRMImporterContext from loaded VRM data (optional)

Returns
Type Description
Task<GameObject>
Remarks

Load from cache if cache exists on device Carry out download if cache doe not exist

Exceptions
Type Condition
Exception

Exception thrown when ModelLoader is not initialized

See Also
LoadVrmAsync(CharacterModel, Action<Single>, Func<VRMData, VRMImporterContext>)
In This Article
Back to top Generated by DocFX