usdrt::UsdUINodeGraphNodeAPI

Defined in usdrt/scenegraph/usd/usdUI/nodeGraphNodeAPI.h

Functions

Variables

class UsdUINodeGraphNodeAPI : public usdrt::UsdAPISchemaBase

/// This api helps storing information about nodes in node graphs.

For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdUITokens. So to set an attribute to the value “rightHanded”, use UsdUITokens->rightHanded as the value.

Public Functions

inline explicit UsdUINodeGraphNodeAPI(const UsdPrim &prim = UsdPrim())

Construct a UsdUINodeGraphNodeAPI on UsdPrim prim. Equivalent to UsdUINodeGraphNodeAPI::Get(prim.GetStage(), prim.GetPath()) for a valid prim , but will not immediately throw an error for an invalid prim.

inline explicit UsdUINodeGraphNodeAPI(const UsdSchemaBase &schemaObj)

Construct a UsdUINodeGraphNodeAPI on the prim held by schemaObj . Should be preferred over UsdUINodeGraphNodeAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.

inline virtual ~UsdUINodeGraphNodeAPI()

Destructor.

inline operator bool() const

Boolean operator.

Returns

Return true if the contained prim is has this api schema applied using HasAPI, and false otherwise.

inline UsdAttribute GetPosAttr() const

/// Declared relative position to the parent in a node graph. X is the horizontal position. Y is the vertical position. Higher numbers correspond to lower positions (coordinates are Qt style, not cartesian).

These positions are not explicitly meant in pixel space, but rather assume that the size of a node is approximately 1.0x1.0. Where size-x is the node width and size-y height of the node. Depending on graph UI implementation, the size of a node may vary in each direction.

Example: If a node’s width is 300 and it is position is at 1000, we store for x-position: 1000 * (1.0/300)

Declaration

uniform float2 ui:nodegraph:node:pos

C++ Type

GfVec2f

Usd Type

SdfValueTypeNames->Float2

Variability

SdfVariabilityUniform

inline UsdAttribute CreatePosAttr() const

See GetPosAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

inline UsdAttribute GetStackingOrderAttr() const

/// This optional value is a useful hint when an application cares about the visibility of a node and whether each node overlaps another.

Nodes with lower stacking order values are meant to be drawn below higher ones. Negative values are meant as background. Positive values are meant as foreground. Undefined values should be treated as 0.

There are no set limits in these values.

Declaration

uniform int ui:nodegraph:node:stackingOrder

C++ Type

int

Usd Type

SdfValueTypeNames->Int

Variability

SdfVariabilityUniform

inline UsdAttribute CreateStackingOrderAttr() const

See GetStackingOrderAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

inline UsdAttribute GetDisplayColorAttr() const

/// This hint defines what tint the node should have in the node graph.

Declaration

uniform color3f ui:nodegraph:node:displayColor

C++ Type

GfVec3f

Usd Type

SdfValueTypeNames->Color3f

Variability

SdfVariabilityUniform

inline UsdAttribute CreateDisplayColorAttr() const

See GetDisplayColorAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

inline UsdAttribute GetIconAttr() const

/// This points to an image that should be displayed on the node. It is intended to be useful for summary visual classification of nodes, rather than a thumbnail preview of the computed result of the node in some computational system.

Declaration

uniform asset ui:nodegraph:node:icon

C++ Type

SdfAssetPath

Usd Type

SdfValueTypeNames->Asset

Variability

SdfVariabilityUniform

inline UsdAttribute CreateIconAttr() const

See GetIconAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

inline UsdAttribute GetExpansionStateAttr() const

/// The current expansionState of the node in the ui. ‘open’ = fully expanded ‘closed’ = fully collapsed ‘minimized’ = should take the least space possible

Declaration

uniform token ui:nodegraph:node:expansionState

C++ Type

TfToken

Usd Type

SdfValueTypeNames->Token

Variability

SdfVariabilityUniform

Allowed Values

open, closed, minimized

inline UsdAttribute CreateExpansionStateAttr() const

See GetExpansionStateAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

inline UsdAttribute GetSizeAttr() const

/// Optional size hint for a node in a node graph. X is the width. Y is the height.

This value is optional, because node size is often determined based on the number of in- and outputs of a node.

Declaration

uniform float2 ui:nodegraph:node:size

C++ Type

GfVec2f

Usd Type

SdfValueTypeNames->Float2

Variability

SdfVariabilityUniform

inline UsdAttribute CreateSizeAttr() const

See GetSizeAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

UsdPrim GetPrim() const

Return this schema object’s held prim.

SdfPath GetPath() const

Return the SdfPath to this schema object’s held prim.

Public Static Functions

static inline UsdUINodeGraphNodeAPI Apply(const UsdPrim &prim)

Applies this single-apply API schema to the given prim. This information is stored by adding “NodeGraphNodeAPI” to the token-valued, listOp metadata apiSchemas on the prim.

See also

UsdPrim::GetAppliedSchemas()

See also

UsdPrim::HasAPI()

See also

UsdPrim::ApplyAPI()

See also

UsdPrim::RemoveAPI()

Returns

A valid UsdUINodeGraphNodeAPI object is returned upon success. An invalid (or empty) UsdUINodeGraphNodeAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.

Public Static Attributes

static const UsdSchemaType schemaType = UsdSchemaType::SingleApplyAPI

Compile time constant representing what kind of schema this class is.

See also

UsdSchemaType

Protected Functions

inline const TfToken &_GetInstanceName() const

Returns the instance name of the API schema object belonging to a multiple-apply API schema.

The returned instance name will be empty for non-applied and single-apply API schemas.