A subgraph is a powerful tool that optimizes graph performance while enhancing readability. Using subgraphs is a recommended best practice. It not only keeps the graph structure tidy but also simplifies the main graph making optimization a more straightforward process.
There are two ways to create a subgraph: instancing a new graph and extracting a graph network.
A graph in InstaMAT Studio can be used inside of another graph to create reusable components. This is known as "instancing" a graph.
To instance a graph:
With InstaMAT Studio, it is easy to extract a set of nodes from a graph and move them into a new one.
To extract a set of nodes into a separate subgraph:
It is important to include any incoming or outgoing connections in the selection. This will automatically create graph inputs and outputs for the subgraph.
Extract Graph Network
from the contextual menu.OK
to create it.Keep in mind that due to the procedural nature of InstaMAT's nodes, InstaMAT Studio will automatically change the seed, causing slight variations in the output. If needed, it's possible to set a constant seed.
It's good practice to set subgraphs to private. Otherwise, when adding the project to your User Library, the subgraphs would also be visible as standalone items.
To set a graph as private:
Canvas
.Meta Data
section, enable Private
.A private graph is indicated by a in the Package Management
panel.
The
Private
setting might be hidden by default. To reveal it, click theMore
button to reveal additional graph meta data settings.