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
Name | Type |
---|---|
importer? | AssetImporter |
materials? | IMaterialManager |
__namedParameters | AssetManagerOptions |
Overrides
SimpleEventDispatcher<''\>.constructor
Methods
addAsset
▸ addAsset(asset
, options?
): Promise
<ISceneObject
<any
>[]>
Parameters
Name | Type |
---|---|
asset | IAsset |
options | ImportAddOptions |
Returns
Promise
<ISceneObject
<any
>[]>
addFromPath
▸ addFromPath(path
, options?
): Promise
<ISceneObject
<any
>[]>
Parameters
Name | Type |
---|---|
path | string |
options | ImportAddOptions |
Returns
Promise
<ISceneObject
<any
>[]>
addProcessedAssets
▸ addProcessedAssets(imported
, options
): (undefined
| ISceneObject
<any
>)[]
Parameters
Name | Type |
---|---|
imported | ISceneObject <any >[] |
options | AddObjectOptions & AddModelOptions |
Returns
(undefined
| ISceneObject
<any
>)[]
addAssetSingle
▸ addAssetSingle<T
>(asset
, options?
): Promise
<undefined
| T
>
Type parameters
Name | Type |
---|---|
T | extends ISceneObject <any > = ISceneObject <any > |
Parameters
Name | Type |
---|---|
asset | undefined | string | IAsset |
options | ImportAddOptions |
Returns
Promise
<undefined
| T
>
addImported
▸ addImported(res
, options?
): Promise
<undefined
| ISceneObject
<any
>[]>
Parameters
Name | Type |
---|---|
res | any |
options | AddImportedOptions |
Returns
Promise
<undefined
| ISceneObject
<any
>[]>
addImportedSingle
▸ addImportedSingle<T
>(res
, options?
): Promise
<undefined
| T
>
Type parameters
Name | Type |
---|---|
T | extends ISceneObject <any > |
Parameters
Name | Type |
---|---|
res | any |
options | AddImportedOptions |
Returns
Promise
<undefined
| T
>
onAdded
▸ onAdded(viewer
): void
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
void
Implementation of
onRemove
▸ onRemove(viewer
): void
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
void
Implementation of
exportViewerConfig
▸ exportViewerConfig(binary?
, meta?
): Record
<string
, any
>
Parameters
Name | Type | Default value | Description |
---|---|---|---|
binary | boolean | true | if set to false, encodes all the array buffers to base64 |
meta? | any | undefined |
Returns
Record
<string
, any
>
exportPluginPresets
▸ exportPluginPresets(filter?
): Object
Parameters
Name | Type |
---|---|
filter? | string [] |
Returns
Object
Name | Type |
---|---|
plugins | undefined | 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
Name | Type |
---|---|
plugin | IViewerPlugin <boolean > |
Returns
any
importPluginPreset
▸ importPluginPreset(json
, plugin?
): Promise
<undefined
| IViewerPlugin
<boolean
>>
Parameters
Name | Type |
---|---|
json | any |
plugin? | IViewerPlugin <boolean > |
Returns
Promise
<undefined
| IViewerPlugin
<boolean
>>
importViewerConfig
▸ importViewerConfig(viewerConfig
, objLoader?
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewerConfig | any |
objLoader? | ObjectLoader2 |
Returns
Promise
<void
>
applyViewerConfig
▸ applyViewerConfig(viewerConfig
, resources?
): void
Parameters
Name | Type |
---|---|
viewerConfig | any |
resources? | any |
Returns
void
importConfigResources
▸ importConfigResources(json
, objLoader?
, extraResources?
): Promise
<any
>
Parameters
Name | Type | Description |
---|---|---|
json | any | |
objLoader? | ObjectLoader2 | |
extraResources? | any | preloaded resources in the format of viewer config resources. |
Returns
Promise
<any
>
Accessors
importer
• get
importer(): undefined
| AssetImporter
Returns
undefined
| AssetImporter
Implementation of
exporter
• get
exporter(): undefined
| IAssetExporter
Returns
undefined
| IAssetExporter
Implementation of
materials
• get
materials(): undefined
| IMaterialManager
Returns
undefined
| IMaterialManager