SubGraph

NodeGraphQt.SubGraph([parent, node, ...])

The SubGraph class is just like the NodeGraph but is the main controller for managing the expanded node graph for a NodeGraphQt.GroupNode.

class NodeGraphQt.SubGraph(parent=None, node=None, node_factory=None, **kwargs)

The SubGraph class is just like the NodeGraph but is the main controller for managing the expanded node graph for a NodeGraphQt.GroupNode.

Inheritance diagram of NodeGraphQt.SubGraph
../_images/sub_graph.png

Attributes:

initialized_graphs

Returns a list of the sub graphs in the order they were initialized.

navigation_widget

The navigation widget from the top most sub graph.

subviewer_widget

The widget to the sub graph.

parent_graph

The parent node graph controller.

node

Returns the parent node to the sub graph.

Methods:

collapse_graph([clear_session])

Collapse the current sub graph and hide its widget.

expand_group_node(node)

Expands a group node session in current sub view.

collapse_group_node(node)

Collapse a group node session and it's expanded child sub graphs.

get_input_port_nodes()

Return all the port nodes related to the group node input ports.

get_output_port_nodes()

Return all the port nodes related to the group node output ports.

get_node_by_port(port)

Returns the node related to the parent group node port object.

property initialized_graphs

Returns a list of the sub graphs in the order they were initialized.

Returns:

list of sub graph objects.

Return type:

list[NodeGraphQt.SubGraph]

property navigation_widget

The navigation widget from the top most sub graph.

Returns:

navigation widget.

Return type:

NodeNavigationWidget

property subviewer_widget

The widget to the sub graph.

Returns:

node graph widget.

Return type:

PySide2.QtWidgets.QWidget

property parent_graph

The parent node graph controller.

Returns:

parent graph.

Return type:

NodeGraphQt.NodeGraph or NodeGraphQt.SubGraph

property node

Returns the parent node to the sub graph.

../_images/group_node.png
Returns:

group node.

Return type:

NodeGraphQt.GroupNode

collapse_graph(clear_session=True)

Collapse the current sub graph and hide its widget.

Parameters:

clear_session (bool) – clear the current session.

expand_group_node(node)

Expands a group node session in current sub view.

Parameters:

node (NodeGraphQt.GroupNode) – group node.

Returns:

sub node graph used to manage the group node session.

Return type:

SubGraph

collapse_group_node(node)

Collapse a group node session and it’s expanded child sub graphs.

Parameters:

node (NodeGraphQt.GroupNode) – group node.

get_input_port_nodes()

Return all the port nodes related to the group node input ports.

../_images/port_in_node.png
Returns:

input nodes.

Return type:

list[NodeGraphQt.PortInputNode]

get_output_port_nodes()

Return all the port nodes related to the group node output ports.

../_images/port_out_node.png
Returns:

output nodes.

Return type:

list[NodeGraphQt.PortOutputNode]

get_node_by_port(port)

Returns the node related to the parent group node port object.

Parameters:

port (NodeGraphQt.Port) – parent node port object.

Returns:

port node object.

Return type:

PortInputNode or PortOutputNode