|
Represents a reference and all its meta data. More...
#include <reference.h>
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. | |
const std::string & | GetAssetPath () const |
Returns the asset path to the root layer of the referenced layer stack. | |
void | SetAssetPath (const std::string &assetPath) |
Sets the asset path for the root layer of the referenced layer stack. | |
const SdfPath & | GetPrimPath () const |
Returns the path of the referenced prim. | |
void | SetPrimPath (const SdfPath &primPath) |
Sets the path of the referenced prim. | |
const SdfLayerOffset & | GetLayerOffset () const |
Returns the layer offset associated with the reference. | |
void | SetLayerOffset (const SdfLayerOffset &layerOffset) |
Sets a new layer offset. | |
const VtDictionary & | GetCustomData () const |
Returns the custom data associated with the reference. | |
void | SetCustomData (const VtDictionary &customData) |
Sets the custom data associated with the reference. | |
SDF_API void | SetCustomData (const std::string &name, const VtValue &value) |
Sets a custom data entry for the reference. | |
void | SwapCustomData (VtDictionary &customData) |
Swaps the custom data dictionary for this reference. | |
SDF_API bool | IsInternal () const |
Returns true in the case of an internal reference. | |
SDF_API bool | operator== (const SdfReference &rhs) const |
Returns whether this reference equals rhs. | |
bool | operator!= (const SdfReference &rhs) const |
SDF_API bool | operator< (const SdfReference &rhs) const |
Returns whether this reference is less than rhs. | |
bool | operator> (const SdfReference &rhs) const |
bool | operator<= (const SdfReference &rhs) const |
bool | operator>= (const SdfReference &rhs) const |
Friends | |
size_t | hash_value (const SdfReference &r) |
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 58 of file reference.h.
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. See SdfAssetPath for what characters are valid in assetPath
. If assetPath
contains invalid characters, issue an error and set this reference's asset path to the empty asset path.
|
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 75 of file reference.h.
|
inline |
Returns the custom data associated with the reference.
Definition at line 120 of file reference.h.
|
inline |
Returns the layer offset associated with the reference.
Definition at line 108 of file reference.h.
|
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 94 of file reference.h.
SDF_API bool IsInternal | ( | ) | const |
Returns true
in the case of an internal reference.
An internal reference is a reference with an empty asset path.
|
inline |
Definition at line 160 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.
|
inline |
Definition at line 174 of file reference.h.
SDF_API bool operator== | ( | const SdfReference & | rhs | ) | const |
Returns whether this reference equals rhs.
|
inline |
Definition at line 169 of file reference.h.
|
inline |
Definition at line 179 of file reference.h.
|
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. See SdfAssetPath for what characters are valid in assetPath
. If assetPath
contains invalid characters, issue an error and set this reference's asset path to the empty asset path.
Definition at line 84 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.
|
inline |
Sets the custom data associated with the reference.
Definition at line 126 of file reference.h.
|
inline |
Sets a new layer offset.
Definition at line 114 of file reference.h.
|
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 102 of file reference.h.
|
inline |
Swaps the custom data dictionary for this reference.
Definition at line 137 of file reference.h.
|
friend |
Definition at line 147 of file reference.h.