Grouping Nodes in the Script Editor
Introduction
Within the Script Editor, you have the ability to create groups to organize and manage a set of nodes. This can greatly improve the readability and maintainability of your scripts, especially as they grow in complexity.
Creating a Group
- Select the desired nodes: Begin by selecting all the nodes you wish to include in the group.
- Group the nodes: Right-click on one of the selected nodes and choose "Group" from the context menu. Alternatively, you can use the keyboard shortcut G.
- Locate the new group: Your newly created group will appear in the left-hand panel of the Script Editor.


Important Considerations for Grouping
In some cases, the selection of nodes might not be valid for creating a group. The most common reason for this is the presence of execution connections with multiple pins (both input and output). To create a valid group, ensure that each execution connection is linked to only one input pin and one output pin.


Working with Groups
- Modifying group nodes: To access and modify the nodes within a group, simply click on the group in the left-hand panel. This will bring the group's contents into focus, allowing you to edit the individual nodes. To return to the main view of your script, click on "Main file" in the left-hand panel.
- Adjusting group settings: To modify the settings of a group, such as its name, header color, and input/output labels, click on the gear icon next to the group in the left-hand panel.

Tips and Best Practices for Grouping
- Leveraging Connectors: If multiple nodes utilize the same input, consider using "Connectors" to avoid creating groups with numerous duplicate inputs. This can help streamline your script and make it easier to understand.
- Duplicating Output Nodes: You can duplicate the "Output" node of a group to create multiple output points. This can be particularly useful in certain scenarios.


By following these guidelines and best practices, you can effectively use groups to enhance your scripting workflow and create more organized and efficient scripts.