traverse_upstream_graph

omni.graph.core.traverse_upstream_graph(prims: List[Prim], attribute_predicate: Optional[Callable[[Attribute], bool]] = None, node_callback: Optional[Callable[[Node], None]] = None) Set[Node]

Traverses the nodes upstream from the input nodes and apply the predicate on visited nodes.

Parameters
  • prims – The list of starting point nodes for the traversal.

  • attribute_predicate – Function taking an Attribute as parameter and returning bool. If True, connections to this attribute are evaluated, otherwise they are skipped.

  • node_callback – Function taking a Node as parameter. Allows for custom logic to be applied to visited nodes.

Returns

The set of visited nodes.

Return type

set[omni.graph.core.Node]

Raises

og.OmniGraphError if the list of prims contains an invalid prim, or the prims do not all belong to the same graph.