All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SdfReference Class Reference

Represents a reference and all its meta data. More...

Inherits totally_ordered< SdfReference >.

Classes

struct  IdentityEqual
 Struct that defines equality of SdfReferences based on their identity (the asset path and prim path). More...
 
struct  IdentityLessThan
 Struct that defines a strict weak ordering of SdfReferences based on their identity (the asset path and prim path). More...
 

Public Member Functions

SDF_API SdfReference (const std::string &assetPath=std::string(), const SdfPath &primPath=SdfPath(), const SdfLayerOffset &layerOffset=SdfLayerOffset(), const VtDictionary &customData=VtDictionary())
 Creates a reference with all its meta data. More...
 
const std::string & GetAssetPath () const
 Returns the asset path to the root layer of the referenced layer stack. More...
 
void SetAssetPath (const std::string &assetPath)
 Sets the asset path for the root layer of the referenced layer stack. More...
 
const SdfPathGetPrimPath () const
 Returns the path of the referenced prim. More...
 
void SetPrimPath (const SdfPath &primPath)
 Sets the path of the referenced prim. More...
 
const SdfLayerOffsetGetLayerOffset () const
 Returns the layer offset associated with the reference. More...
 
void SetLayerOffset (const SdfLayerOffset &layerOffset)
 Sets a new layer offset. More...
 
const VtDictionaryGetCustomData () const
 Returns the custom data associated with the reference. More...
 
void SetCustomData (const VtDictionary &customData)
 Sets the custom data associated with the reference. More...
 
SDF_API void SetCustomData (const std::string &name, const VtValue &value)
 Sets a custom data entry for the reference. More...
 
void SwapCustomData (VtDictionary &customData)
 Swaps the custom data dictionary for this reference. More...
 
SDF_API bool operator== (const SdfReference &rhs) const
 Returns whether this reference equals rhs. More...
 
SDF_API bool operator< (const SdfReference &rhs) const
 Returns whether this reference is less than rhs. More...
 

Friends

size_t hash_value (const SdfReference &r)
 

Detailed Description

Represents a reference and all its meta data.

A reference is expressed on a prim in a given layer and it identifies a prim in a layer stack. All opinions in the namespace hierarchy under the referenced prim will be composed with the opinions in the namespace hierarchy under the referencing prim.

The asset path specifies the layer stack being referenced. If this asset path is non-empty, this reference is considered an 'external' reference to the layer stack rooted at the specified layer. If this is empty, this reference is considered an 'internal' reference to the layer stack containing (but not necessarily rooted at) the layer where the reference is authored.

The prim path specifies the prim in the referenced layer stack from which opinions will be composed. If this prim path is empty, it will be considered a reference to the default prim specified in the root layer of the referenced layer stack – see SdfLayer::GetDefaultPrim.

The meta data for a reference is its layer offset and custom data. The layer offset is an affine transformation applied to all anim splines in the referenced prim's namespace hierarchy, see SdfLayerOffset for details. Custom data is for use by plugins or other non-tools supplied extensions that need to be able to store data associated with references.

Definition at line 75 of file reference.h.

Constructor & Destructor Documentation

SDF_API SdfReference ( const std::string &  assetPath = std::string(),
const SdfPath primPath = SdfPath(),
const SdfLayerOffset layerOffset = SdfLayerOffset(),
const VtDictionary customData = VtDictionary() 
)

Creates a reference with all its meta data.

The default reference is an internal reference to the default prim.

Member Function Documentation

const std::string& GetAssetPath ( ) const
inline

Returns the asset path to the root layer of the referenced layer stack.

This will be empty in the case of an internal reference.

Definition at line 89 of file reference.h.

const VtDictionary& GetCustomData ( ) const
inline

Returns the custom data associated with the reference.

Definition at line 130 of file reference.h.

const SdfLayerOffset& GetLayerOffset ( ) const
inline

Returns the layer offset associated with the reference.

Definition at line 118 of file reference.h.

const SdfPath& GetPrimPath ( ) const
inline

Returns the path of the referenced prim.

This will be empty if the referenced prim is the default prim specified in the referenced layer stack.

Definition at line 104 of file reference.h.

SDF_API bool operator< ( const SdfReference rhs) const

Returns whether this reference is less than rhs.

The meaning of less than is somewhat arbitrary.

SDF_API bool operator== ( const SdfReference rhs) const

Returns whether this reference equals rhs.

void SetAssetPath ( const std::string &  assetPath)
inline

Sets the asset path for the root layer of the referenced layer stack.

This may be set to an empty string to specify an internal reference.

Definition at line 96 of file reference.h.

void SetCustomData ( const VtDictionary customData)
inline

Sets the custom data associated with the reference.

Definition at line 136 of file reference.h.

SDF_API void SetCustomData ( const std::string &  name,
const VtValue value 
)

Sets a custom data entry for the reference.

If value is empty, then this removes the given custom data entry.

void SetLayerOffset ( const SdfLayerOffset layerOffset)
inline

Sets a new layer offset.

Definition at line 124 of file reference.h.

void SetPrimPath ( const SdfPath primPath)
inline

Sets the path of the referenced prim.

This may be set to an empty path to specify a reference to the default prim in the referenced layer stack.

Definition at line 112 of file reference.h.

void SwapCustomData ( VtDictionary customData)
inline

Swaps the custom data dictionary for this reference.

Definition at line 147 of file reference.h.


The documentation for this class was generated from the following file: