Model.upload() function

Upload a model.

Signature:

function upload(file: File, configOrOnProgress?: UploadModelConfig | ProgressFn): Promise<ModelData>;

Parameters

ParameterDescription
fileThe file object of the asset.
configOrOnProgressConfig object for asset uploading. Accept config object or onProgress callback function

Returns:

Promise<ModelData>

a promise contains model object

Example

// using config object
Modelo.Model.upload(file, { reduceTextures: false, onProgress: (percentage) => console.log('upload', percentage) })
// shortcut if progress report is the only thing needed
Modelo.Model.upload(file, (percentage) => console.log('upload', percentage))