Skip to main content

Class: MaterialManager

Core-API.MaterialManager

Hierarchy

Constructors

constructor

new MaterialManager()

Inherited from

AMaterialManager.constructor

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:84

Methods

findOrCreate

findOrCreate(info, params?): undefined | IMaterial<any>

Parameters

NameType
infostring
params?AnyOptions

Returns

undefined | IMaterial<any>

Inherited from

AMaterialManager.findOrCreate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:93


generateFromTemplate

generateFromTemplate(name, params?): undefined | IMaterial<any>

Parameters

NameType
namestring
params?AnyOptions

Returns

undefined | IMaterial<any>

Inherited from

AMaterialManager.generateFromTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:98


generateFromTemplateType

generateFromTemplateType(type, params?): undefined | IMaterial<any>

Parameters

NameType
typestring
params?AnyOptions

Returns

undefined | IMaterial<any>

Inherited from

AMaterialManager.generateFromTemplateType

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:103


findTemplate

findTemplate(name): undefined | IMaterialTemplate

Parameters

NameType
namestring

Returns

undefined | IMaterialTemplate

Inherited from

AMaterialManager.findTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:109


registerMaterial

registerMaterial(material): void

Parameters

NameType
materialIMaterial<any>

Returns

void

Inherited from

AMaterialManager.registerMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:160


registerMaterialObject

registerMaterialObject(material): IMaterial<any>

Parameters

NameType
materialany

Returns

IMaterial<any>

Inherited from

AMaterialManager.registerMaterialObject

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:175


unregisterMaterial

unregisterMaterial(material): void

This is done automatically on material dispose.

Parameters

NameType
materialIMaterial<any>

Returns

void

Inherited from

AMaterialManager.unregisterMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:189


registerMaterialTemplate

registerMaterialTemplate(template): void

Parameters

NameType
templateIMaterialTemplate

Returns

void

Inherited from

AMaterialManager.registerMaterialTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:194


unregisterMaterialTemplate

unregisterMaterialTemplate(template): void

Parameters

NameType
templateIMaterialTemplate

Returns

void

Inherited from

AMaterialManager.unregisterMaterialTemplate

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:203


dispose

dispose(disposeRuntimeMaterials?): void

Parameters

NameTypeDefault value
disposeRuntimeMaterialsbooleantrue

Returns

void

Inherited from

AMaterialManager.dispose

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:207


findMaterial

findMaterial(uuid): undefined | IMaterial<any>

Parameters

NameType
uuidstring

Returns

undefined | IMaterial<any>

Inherited from

AMaterialManager.findMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:220


findMaterialsByName

findMaterialsByName(name, regex?): IMaterial<any>[]

Parameters

NameTypeDefault value
namestring | RegExpundefined
regexbooleanfalse

Returns

IMaterial<any>[]

Inherited from

AMaterialManager.findMaterialsByName

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:224


getMaterialsOfType

getMaterialsOfType<TM>(typeSlug): TM[]

Type parameters

NameType
TMextends IMaterial<any, TM> = IMaterial<any>

Parameters

NameType
typeSlugundefined | string

Returns

TM[]

Inherited from

AMaterialManager.getMaterialsOfType

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:232


getAllMaterials

getAllMaterials(): IMaterial<any>[]

Returns

IMaterial<any>[]

Inherited from

AMaterialManager.getAllMaterials

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:236


processModel

processModel(object, options): IModel<any>

Parameters

NameType
objectIModel<any>
optionsAnyOptions

Returns

IModel<any>

Inherited from

AMaterialManager.processModel

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:240


processMaterial

processMaterial(material, options): IMaterial<any>

Parameters

NameType
materialIMaterial<any>
optionsAnyOptions & { useSourceMaterial?: boolean ; materialTemplate?: string ; register?: boolean }

Returns

IMaterial<any>

Inherited from

AMaterialManager.processMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:267


registerMaterialExtension

registerMaterialExtension(extension): void

Parameters

NameType
extensionMaterialExtension

Returns

void

Inherited from

AMaterialManager.registerMaterialExtension

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:277


unregisterMaterialExtension

unregisterMaterialExtension(extension): void

Parameters

NameType
extensionMaterialExtension

Returns

void

Inherited from

AMaterialManager.unregisterMaterialExtension

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:280


exportMaterial

exportMaterial(material, filename?, minify?, download?): File

Parameters

NameTypeDefault value
materialIMaterial<any>undefined
filename?stringundefined
minifybooleantrue
downloadbooleanfalse

Returns

File

Inherited from

AMaterialManager.exportMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:285


applyMaterial

applyMaterial(material, nameRegexOrUuid, regex?): boolean

Parameters

NameTypeDefault value
materialIMaterial<any>undefined
nameRegexOrUuidstringundefined
regexbooleantrue

Returns

boolean

Inherited from

AMaterialManager.applyMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:294


_refreshTextureRefs

Protected _refreshTextureRefs(materials?): void

Parameters

NameType
materials?IMaterial<any>[]

Returns

void

Inherited from

AMaterialManager._refreshTextureRefs

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:116


_getMapsForMaterial

Protected _getMapsForMaterial(material): Set<ITexture<any>>

Parameters

NameType
materialIMaterial<any>

Returns

Set<ITexture<any>>

Inherited from

AMaterialManager._getMapsForMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:128


_disposeMaterial

Protected _disposeMaterial(e): void

Parameters

NameType
eObject
e.target?IMaterial<any>

Returns

void

Inherited from

AMaterialManager._disposeMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:142


_processMaterial

Protected _processMaterial(material, options): undefined | IMaterial<any>

Parameters

NameType
materialany
optionsAnyOptions & { useSourceMaterial?: boolean ; materialTemplate?: string }

Returns

undefined | IMaterial<any>

Inherited from

AMaterialManager._processMaterial

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:246


_generateFromTemplate

Protected _generateFromTemplate(template, oldMaterial?): undefined | IMaterial<any>

Parameters

NameType
templateIMaterialTemplate
oldMaterial?AnyOptions

Returns

undefined | IMaterial<any>

Overrides

AMaterialManager._generateFromTemplate

Defined in

webgi/src/extras/asset_manager/threejs/MaterialManager.ts:10


_processModel

Protected _processModel(object, options): IModel<any>

Parameters

NameType
objectIModel<any>
options{ recursive?: boolean } & AnyOptions

Returns

IModel<any>

Overrides

AMaterialManager._processModel

Defined in

webgi/src/extras/asset_manager/threejs/MaterialManager.ts:151

Properties

_materialExtensions

Protected _materialExtensions: MaterialExtension[] = []

Inherited from

AMaterialManager._materialExtensions

Defined in

webgi/src/extras/asset_manager/AMaterialManager.ts:275