The Materials
module provides access to the materials in an effect.
This module exposes no properties.
Method | Description |
---|---|
| clone(material: string | MaterialBase, initialState?: {[key: string]: any}): Promise<MaterialBase> Clone a material asynchronously. When creating the materials, keep the following in mind:
Note: This API requires "Scripting Dynamic Instantiation" capability to be enabled. |
| create(className: string, initialState?: {[key: string]: any}): Promise<MaterialBase> Create a material asynchronously. When creating the materials, keep the following in mind:
Note: This API requires "Scripting Dynamic Instantiation" capability to be enabled. |
| destroy(material: string | MaterialBase): Promise<void> Destroy a material asynchronously. When destroying the materials, keep the following in mind:
Note: This API requires "Scripting Dynamic Instantiation" capability to be enabled. |
| findFirst(name: string): Promise<MaterialBase | null> Returns a promise that is resolved with the material of a requested name or null if none was found. See Also: Materials.findUsingPattern , Materials.getAll . |
| findUsingPattern(namePattern: string, config?: {limit: number}): Promise<Array<MaterialBase>> Returns a promise that is resolved with the all of the materials matching the name pattern or empty array if none was found. Pattern format: * matches any characters sequence.\ can be used to include in pattern any of the control characters (including '\' itself)Examples: findUsingPattern("*") will retrive all of the materials.findUsingPattern("*A") will retrieve all of the materials suffixed with 'A'.findUsingPattern("A*") will retrieve all of the materials prefixed with 'A'.findUsingPattern("*A*", {limit: 10}) will retrieve at most 10 of the materials containing 'A',limit parameter describes if findUsingPattern should finish the search if it finds specified number of results (default is no limit). Non-positive values for limit are treated as unlimited.See Also: Materials.getAll , Materials.findFirst . |
| getAll(): Promise<Array<MaterialBase>> Returns a promise that is resolved with all of the materials. See Also: Materials.findUsingPattern , Materials.findFirst . |
Class | Description |
---|---|
BlendedMaterial | The BlendedMaterial class encapsulates materials blended from multiple textures. |
BlendShapeToWarpMapMaterial | The BlendShapeToWarpMapMaterial class is the JS-side representation of the "Face Warp Material" in Spark AR Studio, used to create face warp effects. |
ColorPaintMaterial | The ColorPaintMaterial class encapsulates a face-paint material. |
ComposedMaterial | The ComposedMaterial class encapsulates patch asset materials. |
DefaultMaterial | The DefaultMaterial class encapsulates an image-based material. |
MaterialBase | The MaterialBase class exposes properties common to all material types. |
MetallicRoughnessPbrMaterial | The MetallicRoughnessPbrMaterial class encapsulates physically based materials. |
RetouchingMaterial | The RetouchingMaterial class encapsulates parameters which define the extend of certain beautification techniques. |
TextureTransform | The TextureTransform class encapsulates scaling and translation transforms about a textures UV axis. |