Labels for Reroute nodes in Blender Geometry Nodes

Did you know that you can set your own text labels for Reroute nodes in Blender Geometry Nodes? Since Reroute nodes are most often used to simplify and improve the readability of node trees in Geometry Nodes, marking such nodes with a label with a short informational inscription can be very convenient – you will not need to remember or scroll through the tree of nodes every time to find out where this Reroute data comes from.

Adding a text label to the Reroute node manually is very simple – we need to enter the desired text in the “Label” field in the node properties. The entered text will be displayed above the Reroute node in the node tree.

We can add even more convenience and, using a simple script, add a text label to all Reroute nodes at once, which will inform from which output and from which node the link comes to this Reroute.

First, we need to get a pointer to the Geometry Nodes modifier of the currently active object.

Now we can get a list of all Reroute nodes through the modifier node tree by type.

We can view the current labels through the “label” property of the node.

We can set the desired test ​​for Reroute labels also through the “label” property.

To get the name of the node and the name of the output from which the link comes to the Reroute node, we can use the “links” property of the Geometry Nodes node tree, which stores a list of all links. In the properties of each link, there is a pointer to the node and its input/output to which this link is connected.

Filter only those links in which the end node is the Reroute node.

Loop through the resulting list of links. For each end Reroute node, set the value of the “label” property in the “node name – output name” format, taken from the start node of the link.

Now all Reroute nodes are indicated with a label, which shows us the node and its output, which serve as a source of data for this Reroute node.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Inline Feedbacks
View all comments