public static class SubGraphsA graph inside a graph: the entry and exit nodes, the node type a containing graph stores, and the inlining that removes both before anything is compiled.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Inlining rather than a call. Every target these graphs compile to — Raven source, an array of VFX operations — is a straight-line program over values, and neither has a function to call or a stack to put one on. So a sub-graph is a macro: Flatten turns a graph containing sub-graph nodes into an equivalent graph containing none, and the compiler that walks the result has no idea sub-graphs exist.
The boundary nodes are not registry types. Their ports are the open graph's Interface, so a registry entry for them would have to be re-registered every time a different sub-graph was opened — and two graphs open at once would disagree about what one path meant. Boundary builds the definition for the graph in hand instead, and the view asks for it by name.
⚠ The entry node's ports face the other way from the interface's. A port the interface calls an input — a value the containing graph feeds in — is an output of the entry node, because inside the sub-graph that is where the value comes from. Getting this backwards produces a sub-graph whose wires all refuse to connect and no clue as to why.
Fields and properties (3)
public const string InputTypeThe node type of a sub-graph's entry node, which shows the interface's inputs.
public const string OutputTypeAnd of its exit node, which shows the interface's outputs.
public const int MaximumDepthHow deep sub-graphs may nest before inlining gives up.
Methods (6)
public static NodeTypeDefinition Definition(NodeGraphModel graph, string path)The node type a containing graph stores for a sub-graph.
public static NodeTypeDefinition Boundary(NodeGraphModel graph, string type)The node type of one of a sub-graph's own boundary nodes.
public static bool IsBoundary(string type)Whether a node type is one of the two boundary types.
public static bool ContainsSubGraph(NodeGraphModel graph, ISubGraphSource source)Whether a graph contains any node that stands for a sub-graph.
public static NodeGraphModel Flatten(NodeGraphModel graph, ISubGraphSource source, out IReadOnlyList<NodeDiagnostic> diagnostics)Replaces every sub-graph node with the contents of the graph it stands for.
public static SubGraphExtraction Extract(NodeGraphModel graph, IReadOnlyCollection<NodeId> selection, string name, NodeTypeRegistry? registry = null)Lifts some of a graph's nodes out into a graph of their own, with an interface made of the wires that crossed the boundary.
Used by (7)
- CommandTestsVixen.Editor.NodeGraph.Tests
- FlattenerVixen.Editor.NodeGraph
- NodeGraphCompilerVixen.Editor.NodeGraph
- NodeGraphViewVixen.Editor.NodeGraph
- SubGraphLibraryVixen.Editor.NodeGraph
- SubGraphTestsVixen.Editor.NodeGraph.Tests
- ViewTestsVixen.Editor.NodeGraph.Tests