MaterialsModule
The Materials module provides access to the materials in an effect.
Example
//==============================================================================
// The following example demonstrates how to access a material in the Assets,
// assign it to an object, and change it's opacity.
//
// Project setup:
// - Insert a plane
// - Create a material
//==============================================================================
// Load in the required modules
const Materials = require('Materials');
const Scene = require('Scene');
// Locate the plane in the Scene
const plane = Scene.root.find('plane0');
// Locate the plane in the Scene
const material = Materials.get('defaultMaterial0');
// Assign the material to the plane
plane.material = material;
// Set the opacity of the material to 50%
material.opacity = 0.5;Properties
This module exposes no properties.
Methods
| Method | Description |
|---|---|
|
Returns a promise that is resolved with the material of a requested name or null if none was found. See Also: |
|
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:
Examples:
See Also: |
|
Returns a An exception is thrown when the identifier isn't found in the project. See Also: |
|
Returns a promise that is resolved with all of the materials. See Also: |
Classes
| Class | Description |
|---|---|
The | |
The | |
The | |
The | |
The | |
The | |
The | |
The |