FnUsdAbstractionLib 15.0.8
Loading...
Searching...
No Matches
usg::Relationship Class Reference

#include <Relationship.h>

Public Member Functions

 Relationship ()
 Abstraction handle for casting to UsdRelationship.
 
 Relationship (const Relationship &)
 Copy constructors.
 
Relationshipoperator= (const Relationship &)
 
bool isValid () const
 True if RelationshipHandle is valid (has a valid object binding.)
 
 operator bool () const
 
class Relationship::RelationshipSpecHandle * getSdfRelationshipSpec (int usd_version)
 
const class Relationship::RelationshipSpecHandle * getSdfRelationshipSpec (int usd_version) const
 
class Relationship::UsdRelationshipHandle * getUsdRelationship (int usd_version)
 
const class Relationship::UsdRelationshipHandle * getUsdRelationship (int usd_version) const
 
const std::string & getName () const
 
Path getPath () const
 Full path including the Prim parent.
 
void setTarget (const Path &targetPath)
 Sets the relationship's target path to a single path.
 
Path getTarget () const
 Retrieve the first target path.
 
void setTargets (const PathArray &targetPaths)
 Sets the relationship's target paths.
 
PathArray getTargets () const
 Retrieves the relationship's target paths.
 
 Relationship (const Relationship::Impl &)
 
Relationshipoperator= (const Relationship::Impl &)
 
bool setFromImpl (Relationship::Impl &&b)
 Takes ownership of 'b' - returns true if resulting Relationship is valid.
 
Relationship::Impl * impl ()
 
const Relationship::Impl * impl () const
 

Protected Attributes

std::unique_ptr< Relationship::Impl > _pImpl
 

Friends

USG_API std::ostream & operator<< (std::ostream &o, const Relationship &b)
 Calls through to << operator on the contained data.
 

Detailed Description

Relationships are always attached to Prims so use the Prim interface to create or get access to them.

To create a new Relationship use Prim::createIntrinsicRelationship() or Prim::createCustomRelationship(). To access an existing Relationship use Prim::getRelationship().

TODO: We're only supporting a single relationship target currently! Need multiple targets for PointInstancer, maybe other classes

Constructor & Destructor Documentation

◆ Relationship()

usg::Relationship::Relationship ( )

Abstraction handle for casting to UsdRelationship.

Default ctor builds an empty (invalid) relationship.

Member Function Documentation

◆ getSdfRelationshipSpec()

class Relationship::RelationshipSpecHandle * usg::Relationship::getSdfRelationshipSpec ( int  usd_version)

If the Relationship is bound to an SdfRelationshipSpecHandle return a pointer to the underlying SdfRelationshipSpecHandle object if the usd_version passed in matches the Usd version this library was built with, otherwise return null.

The version must match the one returned by usg::usdAPIVersion().

Caller should cast the returned pointer to an SdfRelationshipSpecHandle* and possibly double-check its validity since a Relationship can be created without a valid binding. However, if Relationship::isValid() returns true then the underlying binding will also be valid.

◆ getUsdRelationship()

class Relationship::UsdRelationshipHandle * usg::Relationship::getUsdRelationship ( int  usd_version)

If the Relationship is bound to a UsdRelationship return a pointer to the underlying UsdRelationship object if the usd_version passed in matches the Usd version this library was built with, otherwise return null.

The version must match the one returned by usg::usdAPIVersion().

Caller should cast the returned pointer to an UsdRelationship* and possibly double-check its validity since a Relationship can be created without a valid binding. However, if Relationship::isValid() returns true then the underlying binding will also be valid.



©2025 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com