usdrt::RtBoundable

Defined in usdrt/scenegraph/usd/rt/boundable.h

Functions

Variables

class RtBoundable : public usdrt::RtXformable

The RtBoundable class provides a schema for reading and writing the Fabric Scene Delegate extent attributes. It also inherits from RtXformable, and can be used for authoring Fabric transform data as well.

The Fabric Scene Delegate (available in Create and all other Kit-based applications) will query Fabric for these special attributes when adding geometry to the Hydra render index. A world extent attribute is currently required by Fabric Scene Delegate for any geometry in Fabric to be considered for rendering.

This API currently allows you to author a world extent attribute for a prim.

Name

Fabric Attribute Name

Type

APIs

worldExtent

_worldExtent

range3d

Create/GetWorldExtentAttr

A helper methods are provided to set either the world-space extent value in Fabric using the computed values from the USD prim:

  • SetWorldExtentFromUsd()

Public Functions

inline RtBoundable(const UsdPrim &prim = UsdPrim())

Construct a RtBoundable instance from a UsdPrim. Providing an invalid UsdPrim will result in an invalid RtBoundable.

Parameters

prim – The prim to use to construct the RtBoundable

RtBoundable(const RtBoundable &boundable) = default

Copy constructor.

inline UsdAttribute GetWorldExtentAttr() const

World extent is the absolute, world-space extent of the prim. This attribute is required by Fabric Scene Delegate to render geometry with Hydra.

C++ Type

GfRange3d

ValueTypeName

Range3d

inline UsdAttribute CreateWorldExtentAttr(const GfRange3d &defaultValue = GfRange3d()) const

Create or get the existing world extent attribute.

Parameters

defaultValue – The value to set when creating the world extent attribute in Fabric

inline bool HasWorldExtent() const

Check if the Fabric prim has a world extent attribute.

Returns

true if any world extent attribute exists in Fabric

inline bool ClearWorldExtent()

Remove the world extent attribute from the Fabric prim.

Returns

true if a world extent attribute existed and was removed

inline bool SetWorldExtentFromUsd()

Set the world extent from the underlying USD prim.

Returns

true if the world extent attribute was created and set or updated from USD

inline operator bool() const

Returns true if the underlying UsdPrim is valid, False otherwise.

inline UsdPrim GetPrim() const

Return the held UsdPrim.

inline SdfPath GetPath() const

Return the SdfPath of the held UsdPrim.

inline UsdAttribute GetFabricHierarchyLocalMatrixAttr() const

Fabric Hierarchy local matrix is the local transform of the prim, relative to its parent when Fabric Scene Delegate is enabled. Changes to this attribute will cause the Fabric Hierarchy world matrix value to be updated on a subsequent call to IFabricHierarcy::updateWorldXforms - this happens automatically before each render frame when Fabric Scene Delegate is enabled.

C++ Type

GfMatrix4d

ValueTypeName

Matrix4d

inline UsdAttribute CreateFabricHierarchyLocalMatrixAttr(const GfMatrix4d &defaultValue = GfMatrix4d(1)) const

Create or get the existing Fabric Hierarchy local matrix attribute.

Parameters

defaultValue – The value to set when creating the local matrix attribute in Fabric

inline UsdAttribute GetFabricHierarchyWorldMatrixAttr() const

Fabric Hierarchy world matrix is the local-to-world transform of the prim when Fabric Scene Delegate is enabled. Changes to this attribute will cause the Fabric Hierarchy local matrix value to be updated on a subsequent call to IFabricHierarcy::updateWorldXforms, by computing the value relative to the computed world transform of the parent prim - this happens automatically before each render frame when Fabric Scene Delegate is enabled.

C++ Type

GfMatrix4d

ValueTypeName

Matrix4d

inline UsdAttribute CreateFabricHierarchyWorldMatrixAttr(const GfMatrix4d &defaultValue = GfMatrix4d(1)) const

Create or get the existing Fabric Hierarchy world matrix attribute.

Parameters

defaultValue – The value to set when creating the world matrix attribute in Fabric

inline UsdAttribute GetWorldPositionAttr() const

World Position is the absolute, world-space translation of the prim. If this attribute is set in Fabric, OmniHydra will disregard all other transform data for this prim and use this and any other world transform attributes in Fabric for the Hydra rprim.

C++ Type

GfVec3d

ValueTypeName

Double3

inline UsdAttribute CreateWorldPositionAttr(const GfVec3d &defaultValue = GfVec3d(0)) const

Create or get the existing world position attribute.

Parameters

defaultValue – The value to set when creating the world position attribute in Fabric

inline UsdAttribute GetWorldOrientationAttr() const

World Orientation is the absolute, world-space rotation of the prim. If this attribute is set in Fabric, OmniHydra will disregard all other transform data for this prim and use this and any other world transform attributes in Fabric for the Hydra rprim.

C++ Type

GfQuatf

ValueTypeName

Quatf

inline UsdAttribute CreateWorldOrientationAttr(const GfQuatf &defaultValue = GfQuatf(1)) const

Create or get the existing world orientation attribute.

Parameters

defaultValue – The value to set when creating the world orientation attribute in Fabric

inline UsdAttribute GetWorldScaleAttr() const

World Scale is the absolute, world-space scale of the prim. If this attribute is set in Fabric, OmniHydra will disregard all other transform data for this prim and use this and any other world transform attributes in Fabric for the Hydra rprim.

C++ Type

GfVec3f

ValueTypeName

Vector3f

inline UsdAttribute CreateWorldScaleAttr(const GfVec3f &defaultValue = GfVec3f(1)) const

Create or get the existing world scale attribute.

Parameters

defaultValue – The value to set when creating the world scale attribute in Fabric

inline UsdAttribute GetLocalMatrixAttr() const

Local Matrix is the local transform of the prim, relative to its parent. Updates to ancestor transforms will continue to affect the overall transform of this prim in OmniHydra. If this attribute is set in Fabric, OmniHydra will disregard any local transform data for this prim in USD. If any world transform attributes are set for the prim in Fabric, this attribute will be ignored by OmniHydra.

C++ Type

GfMatrix4d

ValueTypeName

Matrix4d

inline UsdAttribute CreateLocalMatrixAttr(const GfMatrix4d &defaultValue = GfMatrix4d(1)) const

Create or get the existing local matrix attribute.

Parameters

defaultValue – The value to set when creating the local matrix attribute in Fabric

inline bool HasWorldXform() const

Check if the Fabric prim has any world transform attributes.

Returns

true if any world transform attributes exist in Fabric

inline bool ClearWorldXform()

Remove any world transform attributes from the Fabric prim.

Returns

true if any world transform attributes existed and were removed

inline bool SetWorldXformFromUsd()

Set the world position, orientation, and scale from the underlying USD prim.

Returns

true if all world transform attributes were created and set or updated from USD

inline bool HasLocalXform() const

Check if the Fabric prim has the local transform attribute set.

Returns

true if the local transform attribute exists in Fabric

inline bool ClearLocalXform()

Remove the local transform attribute from the Fabric prim.

Returns

true if the local transform attribute existed and was removed

inline bool SetLocalXformFromUsd() const

Set the local transform attribute in Fabric from the underlying USD prim’s local transform relative to its parent.

Returns

true if the local transform attribute was created and set or updated from USD

Protected Attributes

UsdPrim m_prim