usdrt::UsdRelationship

Defined in usdrt/scenegraph/usd/usd/impl/usd_decl.h

class UsdRelationship

A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other prims, attributes, or relationships.

Public Functions

bool AddTarget(const SdfPath &target, UsdListPosition position = UsdListPositionBackOfPrependList) const

Add target to list of targets based on the specified UsdListPosition heuristic.

Parameters
  • targetSdfPath to the new target to add.

  • position – UsdListPosition heuristic for where to add the new target in the list.

Returns

Return true if the new target has been set. False otherwise.

bool RemoveTarget(const SdfPath &target) const

Remove target from list of targets based.

Parameters

targetSdfPath to the target to remove.

Returns

Return true if the target has been removed or if it did not exist in the list of targets. False otherwise.

bool SetTargets(const SdfPathVector &targets) const

Explicitly set a new list of targets for this relationship.

Parameters

targets – A vector of SdfPaths to set as the new list of targets.

Returns

Return true if the list of targets has been set, and false otherwise.

bool ClearTargets(bool removeSpec) const

Remove all targets from this relationship.

Parameters

removeSpec – This argument is ignored. Usdrt does not have prim specs.

Returns

Return true if the list of targets has been set to empty.

bool GetTargets(SdfPathVector *targets) const

Get a list of targets for this relationship.

Parameters

targets[out] The list of targets as an SdfPathVector.

Returns

Return true if the targets have been fetched. False otherwise.

bool GetForwardedTargets(SdfPathVector *targets) const

Get a list of targets for this relationship.

Note

Fabric does not resolve forwarded targets. This is equivalent to UsdRelationship::GetTargets.

Parameters

targets[out] The list of targets as an SdfPathVector.

Returns

Return true if the targets have been fetched. False otherwise.

bool HasAuthoredTargets() const

Check if this relationship has any authored targets.

Note

This diverges from the USD behavior. USD checks for authored opinions that add or remove targets in the current edit target layer. These concepts don’t apply to Fabric, so we only check if there is currently at least one target set.

Returns

Return true if this relationship has any authored targets.

bool IsValid() const

Check if the relationship is valid (i.e exists in fabric).

Returns

Return true if the attribute exists in fabric, and false otherise.

UsdStageRefPtr GetStage() const

Get the fabric stage holding this UsdRelationship.

Returns

Return a pointer to the fabric stage that contains this attribute.

UsdPrim GetPrim() const

Get the prim associated with this relationship on the existing fabric stage.

Returns

Return a pointer to the prim that has this relationship.

const TfToken GetName() const

Get this relationship’s name.

Returns

Return this relationship name as a TfToken.

SdfPath GetPath() const

Get the path to this relationship.

Returns

Return the SdfPath path to this relationship.

const SdfPath GetPrimPath() const

Get the path to the prim that has this relationship.

Returns

Return the SdfPath to the prim that has this relationship.

explicit operator bool() const

Check if this relationship is valid. See UsdRelationship::IsValid.

Returns

Return true if this relationship is valid, and false otherwise.

TfToken GetBaseName() const

Get this property’s name with all namespace prefixes removed.

Returns

Return this property’s name with all namespace prefixes removed as a TfToken.

TfToken GetNamespace() const

Get this property’s complete namespace prefix.

Returns

Return this property’s complete namespace prefix as a TfToken. Empty token if not a namespaced property.

std::vector<std::string> SplitName() const

Get this property’s name elements including namespaces and its base name as the final element.

Returns

this property’s name elements including namespaces and its base name as the final element.