MaterialPropertyOverrides
ClassOverrides the passes of one material on a single visual.
- Available on all platforms
Since Lens Scripting v304
Overrides the passes of one material on a single visual. Index it with a pass number to get that pass's PassPropertyOverrides. Used with MaterialMeshVisual.
Assigning an object to a pass (overrides[0] = { baseColor: vec4.one() }) sets the keys of the object and removes
all other keys of that pass. Assigning null, or any value that is not an object, removes that pass's overrides,
and so does delete overrides[0] (Lens Scripting version 386).
See PropertyOverrides for the Lens Scripting version each form needs.
Index
Methods
Example
//@input Component.MaterialMeshVisual visual
const material = script.visual.propertyOverrides[0];
material[0].baseColor = new vec4(1, 0, 0, 1);
material[0] = null; // removes pass 0's overrides
material[1] = { baseColor: new vec4(0, 1, 0, 1) };
delete material[1]; // removes pass 1's overrides
Extends
Indexable
[
index:string]:any
Methods
getTypeName()
staticgetTypeName():TypeName<MaterialPropertyOverrides>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<MaterialPropertyOverrides>
Since
Lens Scripting Version 304
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean