Skip to main content

Class: AssetManagerPlugin

Core-API.AssetManagerPlugin

Hierarchy

  • SimpleEventDispatcher<"">

    AssetManagerPlugin

Implements

Properties

PluginType

Static Readonly PluginType: "AssetManager"


ViewerTypeSlug

Static Readonly ViewerTypeSlug: "vjson"


storage

Optional Readonly storage: Storage | Cache

Constructors

constructor

new AssetManagerPlugin(importer?, materials?, __namedParameters?)

Parameters

NameType
importer?AssetImporter
materials?IMaterialManager
__namedParametersAssetManagerOptions

Overrides

SimpleEventDispatcher<''\>.constructor

Methods

addAsset

addAsset(asset, options?): Promise<ISceneObject<any>[]>

Parameters

NameType
assetIAsset
optionsImportAddOptions

Returns

Promise<ISceneObject<any>[]>


addFromPath

addFromPath(path, options?): Promise<ISceneObject<any>[]>

Parameters

NameType
pathstring
optionsImportAddOptions

Returns

Promise<ISceneObject<any>[]>


addProcessedAssets

addProcessedAssets(imported, options): (undefined | ISceneObject<any>)[]

Parameters

NameType
importedISceneObject<any>[]
optionsAddObjectOptions & AddModelOptions

Returns

(undefined | ISceneObject<any>)[]


addAssetSingle

addAssetSingle<T>(asset, options?): Promise<undefined | T>

Type parameters

NameType
Textends ISceneObject<any> = ISceneObject<any>

Parameters

NameType
assetundefined | string | IAsset
optionsImportAddOptions

Returns

Promise<undefined | T>


addImported

addImported(res, options?): Promise<undefined | ISceneObject<any>[]>

Parameters

NameType
resany
optionsAddImportedOptions

Returns

Promise<undefined | ISceneObject<any>[]>


addImportedSingle

addImportedSingle<T>(res, options?): Promise<undefined | T>

Type parameters

NameType
Textends ISceneObject<any>

Parameters

NameType
resany
optionsAddImportedOptions

Returns

Promise<undefined | T>


onAdded

onAdded(viewer): void

Parameters

NameType
viewerViewerApp

Returns

void

Implementation of

IViewerPluginSync.onAdded


onRemove

onRemove(viewer): void

Parameters

NameType
viewerViewerApp

Returns

void

Implementation of

IViewerPluginSync.onRemove


exportViewerConfig

exportViewerConfig(binary?, meta?): Record<string, any>

Parameters

NameTypeDefault valueDescription
binarybooleantrueif set to false, encodes all the array buffers to base64
meta?anyundefined

Returns

Record<string, any>


exportPluginPresets

exportPluginPresets(filter?): Object

Parameters

NameType
filter?string[]

Returns

Object

NameType
pluginsundefined | any[]
resources{ geometries: {} = {}; materials: {} = {}; textures: {} = {}; images: {} = {}; shapes: {} = {}; skeletons: {} = {}; animations: {} = {}; extras: {} = {} }
resources.geometries{}
resources.materials{}
resources.textures{}
resources.images{}
resources.shapes{}
resources.skeletons{}
resources.animations{}
resources.extras{}

exportPluginPreset

exportPluginPreset(plugin): any

Parameters

NameType
pluginIViewerPlugin<boolean>

Returns

any


importPluginPreset

importPluginPreset(json, plugin?): Promise<undefined | IViewerPlugin<boolean>>

Parameters

NameType
jsonany
plugin?IViewerPlugin<boolean>

Returns

Promise<undefined | IViewerPlugin<boolean>>


importViewerConfig

importViewerConfig(viewerConfig, objLoader?): Promise<void>

Parameters

NameType
viewerConfigany
objLoader?ObjectLoader2

Returns

Promise<void>


applyViewerConfig

applyViewerConfig(viewerConfig, resources?): void

Parameters

NameType
viewerConfigany
resources?any

Returns

void


importConfigResources

importConfigResources(json, objLoader?, extraResources?): Promise<any>

Parameters

NameTypeDescription
jsonany
objLoader?ObjectLoader2
extraResources?anypreloaded resources in the format of viewer config resources.

Returns

Promise<any>

Accessors

importer

get importer(): undefined | AssetImporter

Returns

undefined | AssetImporter

Implementation of

IAssetManager.importer


exporter

get exporter(): undefined | IAssetExporter

Returns

undefined | IAssetExporter

Implementation of

IAssetManager.exporter


materials

get materials(): undefined | IMaterialManager

Returns

undefined | IMaterialManager