Capítulo 432 de 859

Chapter 432: MaterialReferenceNode

Core Idea

This node is a special type of reference node which is intended for linking material properties with node values.

When changing material.opacity, the node value of opacityNode will automatically be updated.

Key Concepts

  • isMaterialReferenceNode : boolean (readonly): This flag can be used for type testing.
  • material : Material: The material the property belongs to. When no material is set, the node refers to the material of the current rendered object.

Code Examples

const opacityNode = materialReference( 'opacity', 'float', material );
  • What it demonstrates: Typical usage of MaterialReferenceNode.

Reference Tables

Constructor

Signature
new MaterialReferenceNode( property : string, inputType : string, material : Material )

Properties

PropertyDescription
.isMaterialReferenceNode : boolean (readonly)This flag can be used for type testing.
.material : MaterialThe material the property belongs to. When no material is set, the node refers to the material of the current rendered object.

Methods

MethodDescription
`.updateReference( state : NodeFrameNodeBuilder ) : Object`

Key Takeaways

  1. MaterialReferenceNode extends: EventDispatcher → Node → ReferenceNode
  2. Most relevant properties: isMaterialReferenceNode, material.
  3. Key methods: updateReference.

Connects To