NodesUsdAPI

Initialisation for NodesUsdAPI module

class NodesUsdAPI.NodeUsd

Bases: CommonNodeInterface, PythonNode

Base class for usd nodes which implements the CommonNodeInterface.

Derived nodes should implement _getEngineChain which specifies the node’s engine chain on the engine chain interface. The engines themselves are then created on a given traversal’s transaction in onTraversalVisit which is the main interface to the traversal.

__init__() None
onTraversalVisit(port, transaction, inputs, graphState, visitedState, forceProcessing)

Called by the traversal to append this node’s engines to the transaction.

getEngineIds()
Returns:

A list UsdProcessingEngine.VecIds of the EngineIds last made by this node from the last time it was called upon to provide traversal information in onTraversalVisit().

Return type:

UsdProcessingEngine.VecIds

static getFamilyType()

This method should be overridden in a derived class. It should return a type which is the base for further derived types. For example any Geolib nodes would return the same string from this function and any USD nodes would return a different string.

Returns:

The type for which derived nodes are a part of.

getOutputState()

Return current output state of transaction

getIncomingLocalUsgValue(prim, paramName)

Used by the StageParameterPolicy to retrieve usg.Value data from a prim (either attribute data, metadata or relationship). It is up to this method what data is given to the StageParameterPolicy for a given parameter name. The default behaviour is to get attribute data from that prim, with paramName that matches a USD attribute name.

Return type:

usg.Value

Parameters:
  • prim (usg.Prim) – The prim to extract the data provided by the UsgValueSource.

  • paramName (str) – Name of parameter/usg attribute used for the policy.

Returns:

A usg.Value value.

NodesUsdAPI.GetStage(node, maskPaths=None)

Returns the composed stage from this node. This starts a traversal from the node specified by the node argument.

Return type:

usg.Stage

Parameters:
  • node (NodegraphAPI.Node) – The node in the scene to traverse from.

  • maskPaths (usg.PathArray) – The :py:obj:`usg.Path`s to pass to the stage to mask composition.

Returns:

The composed stage from this node.

NodesUsdAPI.GetStageAndState(node, maskPaths=None, customGraphState=None)

Returns the composed stage from this node and a hash representing its state.

This kicks off a traversal from the node which is passed in, including geolib nodes as the stage could potentially depend on geolib processing.

NodesUsdAPI.GetUsdSourceFromNodeInput(node, inputPortName, graphState)

Get a USD source [output] port for the specified node input by traversing connections to a source port.

Return type:

NodegraphAPI.Port or None

Parameters:
Returns:

An output port of a NodeUsd instance, or None if no source is found, or the source is not a USD node.

Raises:

TypeError – incorrect argument type.