Class: MaterialPresetPlugin
Plugins.MaterialPresetPlugin
Hierarchy
AViewerPlugin
<"loadPresets"
>↳
MaterialPresetPlugin
Properties
PluginType
▪ Static
Readonly
PluginType: "MaterialPresetPlugin"
serializeWithViewer
• serializeWithViewer: boolean
= false
enabled
• enabled: boolean
= true
Overrides
mapping
• mapping: { name
: string
; path
: string
; regex?
: false
}[] = []
presets
• presets: any
= {}
basePath
• basePath: undefined
| string
applyOnLoad
• applyOnLoad: boolean
= true
replaceMaterial
• replaceMaterial: boolean
= true
_dirty
• Protected
_dirty: boolean
= false
Inherited from
_viewer
• Protected
Optional
_viewer: ViewerApp
Inherited from
Constructors
constructor
• new MaterialPresetPlugin()
Inherited from
Accessors
dirty
• get
dirty(): boolean
Returns
boolean
Inherited from
AViewerPlugin.dirty
• set
dirty(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
AViewerPlugin.dirty
viewer
• get
viewer(): undefined
| ViewerApp
Returns
undefined
| ViewerApp
Inherited from
AViewerPlugin.viewer
Methods
onDispose
▸ onDispose(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
onRemove
▸ onRemove(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
toJSON
▸ toJSON(meta?
): any
Parameters
Name | Type |
---|---|
meta? | any |
Returns
any
Inherited from
exportState
▸ exportState(): any
Returns
any
Inherited from
importState
▸ importState(state
): Promise
<void
>
Parameters
Name | Type |
---|---|
state | any |
Returns
Promise
<void
>
Inherited from
storeState
▸ storeState(prefix?
, storage?
, data?
): void
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
data? | any |
Returns
void
Inherited from
loadState
▸ loadState(prefix?
, storage?
): Promise
<void
>
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
Returns
Promise
<void
>
Inherited from
onAdded
▸ onAdded(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Overrides
loadPresets
▸ loadPresets(data
, basePath?
): void
Parameters
Name | Type |
---|---|
data | any |
basePath? | string |
Returns
void
getMaterialPresetByName
▸ getMaterialPresetByName(option
): any
Parameters
Name | Type |
---|---|
option | any |
Returns
any
fromJSON
▸ fromJSON(data
, meta?
): Promise
<null
| MaterialPresetPlugin
>
Parameters
Name | Type |
---|---|
data | any |
meta? | any |
Returns
Promise
<null
| MaterialPresetPlugin
>
Overrides
applyAll
▸ applyAll(): Promise
<void
>
Returns
Promise
<void
>
addMapping
▸ addMapping(name
, materialURL
, apply?
): Promise
<void
>
Parameters
Name | Type | Default value |
---|---|---|
name | string | undefined |
materialURL | string | undefined |
apply | boolean | true |
Returns
Promise
<void
>
_storeKey
▸ Protected
_storeKey(prefix?
): string
Parameters
Name | Type |
---|---|
prefix? | string |
Returns
string
Inherited from
_apply
▸ Protected
_apply(name
, materialURL
, regex?
): Promise
<void
>
Parameters
Name | Type | Default value |
---|---|---|
name | string | undefined |
materialURL | string | undefined |
regex | boolean | true |
Returns
Promise
<void
>