You can use the Group node to nest multiple nodes inside a single node.
1. | Select all the nodes you want to nest inside the Group node. |
2. | If you want to replace the original nodes with the Group node, right-click and select Edit > Node > Group > Collapse To Group (or press Ctrl/Cmd+G on the Node Graph). |
If you want to keep the original nodes in the layout in addition to the Group node, right-click and select Edit > Node > Group > Copy Nodes To Group (or press Ctrl/Cmd+Alt+Shift+G on the Node Graph).
The selected nodes are nested into a group. The internal structure of the Group node is shown on a separate tab that opens.
TIP: As an alternative to Edit > Node > Group > Collapse to Group, you can also select Other > Group from the Toolbar or the Node Graph right-click menu.
In the Group node’s controls, click the S button (short for Show) in the top right corner.
A new tab that contains the nested nodes opens.
1. | Select the Group node in the Node Graph. |
2. | Select Edit > Node > Group > Expand Group (or press Ctrl/Cmd+Alt+G). |
The Group node is replaced with the nodes that were nested inside it.
OR
1. | In the Group node’s controls, click the S button in the top right corner. |
A new tab that contains the nested nodes opens.
2. | Copy the nodes from the new tab into your script. If you want to lock the connections between the grouped nodes so that they cannot be accidentally disconnected during the copy-paste operation, check lock all connections in the Group node’s controls. |
3. | Delete the unnecessary Group node from your script. |