Capítulo 444 de 859

Chapter 444: OverrideContextNode

Core Idea

A specialized context node designed to override specific target nodes within a node sub-graph or flow. This allows replacing specific inputs (e.g., normal and position vectors) dynamically during compilation for a specific flow node, without having to reconstruct or duplicate the source nodes.

Key Concepts

  • isOverrideContextNode : boolean (readonly): This flag can be used for type testing.
  • type : string (readonly): Returns the type of the node.

Code Examples

// Method chaining example:
node.overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
// Context assignment example:
material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
  • What it demonstrates: Typical usage of OverrideContextNode.

Reference Tables

Constructor

Signature
`new OverrideContextNode( overrideNodes : Map.<Node, function()>, flowNode : Node

Properties

PropertyDescription
.isOverrideContextNode : boolean (readonly)This flag can be used for type testing.
.type : string (readonly)Returns the type of the node.

Methods

MethodDescription
.getFlowContextData() : ObjectGathers the context data from all parent context nodes by traversing the hierarchy, merging the overrideNodes maps from all encountered OverrideContextNode instances.

Key Takeaways

  1. OverrideContextNode extends: EventDispatcher → Node → ContextNode
  2. Most relevant properties: isOverrideContextNode, type.
  3. Key methods: getFlowContextData.

Connects To