📄 threejs/Core/Nodes/SetNode

File: SetNode.md | Updated: 11/15/2025


title: SetNode category: Core layout: docs

SetNode

This module is part of the TSL core and usually not used in app level code. SetNode represents a set operation which means it is used to implement any setXYZW(), setRGBA() and setSTPQ() method invocations on node objects. For example:

Code Example

materialLine.colorNode = color( 0, 0, 0 ).setR( float( 1 ) );

Constructor

new SetNode( sourceNode : Node, components : string, targetNode : Node )

Constructs a new set node.

sourceNode | The node that should be updated.
---|---
components | The components that should be updated.
targetNode | The value node.

Properties

.components : string

The components that should be updated.

.sourceNode : Node

The node that should be updated.

.targetNode : Node

The value node.

Methods

.getNodeType( builder : NodeBuilder ) : string

This method is overwritten since the node type is inferred from SetNode#sourceNode.

builder | The current node builder.
---|---

Overrides: TempNode#getNodeType

Returns: The node type.

Source

src/nodes/utils/SetNode.js