AbstractGraphNodeDelegate

class omni.kit.widget.graph.abstract_graph_node_delegate.AbstractGraphNodeDelegate

Bases: object

The delegate generates widgets that together form the node using the model. The following figure shows the LIST layout of the node. For every zone, there is a method that is called to build this zone.

+-------------------------+
|     node_background     |
| +---+-------------+---+ |
| |[A]| node_header |[B]| |
| +---+-------------+---+ |
| |[C]|    port     |[D]| |
| +---+-------------+---+ |
| |[D]|    port     |[D]| |
| +---+-------------+---+ |
| |[E]| node_footer |[F]| |
| +---+-------------+---+ |
+-------------------------+

COLUMN layout allows to put input and output ports at the same line:

+-------------------------+
|     node_background     |
| +---+-------------+---+ |
| |[A]| node_header |[B]| |
| +---+------+------+---+ |
| |[C]| port | port |[D]| |
| |   |      |------+---| |
| |---+------| port |[D]| |
| |[D]| port |      |   | |
| +---+------+------+---+ |
| |[E]| node_footer |[F]| |
| +---+-------------+---+ |
+-------------------------+
[A] node_header_input
[B] node_header_output
[C] port_input
[D] port_output
[E] node_footer_input (TODO)
[F] node_footer_output (TODO)

Methods

connection(model, source_desc, target_desc)

Called to create the connection between ports.

destroy()

get_node_layout(model, node_desc)

Called to determine the node layout

node_background(model, node_desc)

Called to create widgets of the node background

node_footer(model, node_desc)

Called to create widgets of the bottom of the node

node_header(model, node_desc)

Called to create widgets of the top of the node

node_header_input(model, node_desc)

Called to create the left part of the header that will be used as input when the node is collapsed

node_header_output(model, node_desc)

Called to create the right part of the header that will be used as output when the node is collapsed

port(model, node_desc, port_desc)

Called to create the middle part of the port

port_input(model, node_desc, port_desc)

Called to create the left part of the port that will be used as input

port_output(model, node_desc, port_desc)

Called to create the right part of the port that will be used as output

__init__()
connection(model, source_desc: GraphConnectionDescription, target_desc: GraphConnectionDescription, foreground: bool = False)

Called to create the connection between ports. This method can be called twice - once as a background pass, once as a foreground pass, which is what the `foreground` parameter denotes. The foreground pass is off by default, but is useful for curve anchor floating value displays that need to be in front of all nodes.

get_node_layout(model, node_desc: GraphNodeDescription)

Called to determine the node layout

node_background(model, node_desc: GraphNodeDescription)

Called to create widgets of the node background

Called to create widgets of the bottom of the node

node_header(model, node_desc: GraphNodeDescription)

Called to create widgets of the top of the node

node_header_input(model, node_desc: GraphNodeDescription)

Called to create the left part of the header that will be used as input when the node is collapsed

node_header_output(model, node_desc: GraphNodeDescription)

Called to create the right part of the header that will be used as output when the node is collapsed

port(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)

Called to create the middle part of the port

port_input(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)

Called to create the left part of the port that will be used as input

port_output(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)

Called to create the right part of the port that will be used as output