Skip to content

Input & Output outlets

bandinopla edited this page Mar 30, 2025 · 1 revision

When creating a connection between nodes, the user will click an "outlet" ( a point of input or output ) and reach to another outlet, creating a connection. Outlets connect nodes and also convert data leveraging node swizzle.

A node will eventually create a tsl node, and then the outlets can "extract" the components they need.

IOutlet

The interface src/core/IOutlet is the one used by outlets to work as such. They provide means to know if the outlet is input or output, the position XY, the reference to the Node that owns them and the "other" outlet to which it is connected.

Size

An outlet can have a size from 1 to 4 components, with 5 being used for "material" type. For example a node might generate an size 4 node, but the output outlet might just use 1, like for example an outlet that only outputs the "alpha" of a texture node, it will just export the ".a" component and be size=1

writeScript

An outlet also implements this method because this is the method used to interact and connect the node with the outside. Same example as before, the input outlet might be connected to a vec3 node's outlet, but it will only read the first 2 components befoe passing that down to the node to which it belongs.

Clone this wiki locally