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

Classes

Enums

Last updated