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

#include <variantSpec.h>

+ Inheritance diagram for SdfVariantSpec:

Public Member Functions

Name
SDF_API std::string GetName () const
 Returns the name of this variant. More...
 
SDF_API TfToken GetNameToken () const
 Returns the name of this variant. More...
 
Namespace hierarchy
SDF_API SdfVariantSetSpecHandle GetOwner () const
 Return the SdfVariantSetSpec that owns this variant. More...
 
SDF_API SdfPrimSpecHandle GetPrimSpec () const
 Get the prim spec owned by this variant. More...
 
SDF_API SdfVariantSetsProxy GetVariantSets () const
 
SDF_API std::vector< std::stringGetVariantNames (const std::string &name) const
 Returns list of variant names for the given variant set. More...
 
- Public Member Functions inherited from SdfSpec
SDF_API SdfSpecoperator= (const SdfSpec &other)
 
SDF_API ~SdfSpec ()
 
SDF_API const SdfSchemaBaseGetSchema () const
 Returns the SdfSchemaBase for the layer that owns this spec. More...
 
SDF_API SdfSpecType GetSpecType () const
 
SDF_API bool IsDormant () const
 Returns true if this object is invalid or expired. More...
 
SDF_API SdfLayerHandle GetLayer () const
 Returns the layer that this object belongs to. More...
 
SDF_API SdfPath GetPath () const
 Returns the scene path of this object. More...
 
SDF_API bool PermissionToEdit () const
 Returns whether this object's layer can be edited. More...
 
SDF_API std::vector< TfTokenListInfoKeys () const
 
SDF_API std::vector< TfTokenGetMetaDataInfoKeys () const
 
SDF_API TfToken GetMetaDataDisplayGroup (TfToken const &key) const
 
SDF_API VtValue GetInfo (const TfToken &key) const
 
SDF_API void SetInfo (const TfToken &key, const VtValue &value)
 
SDF_API void SetInfoDictionaryValue (const TfToken &dictionaryKey, const TfToken &entryKey, const VtValue &value)
 
SDF_API bool HasInfo (const TfToken &key) const
 
SDF_API void ClearInfo (const TfToken &key)
 
SDF_API TfType GetTypeForInfo (const TfToken &key) const
 Returns the data type for the info with the given key. More...
 
SDF_API const VtValueGetFallbackForInfo (const TfToken &key) const
 Returns the fallback for the info with the given key. More...
 
SDF_API bool WriteToStream (std::ostream &, size_t indent=0) const
 Writes this spec to the given stream. More...
 
SDF_API bool IsInert (bool ignoreChildren=false) const
 
SDF_API std::vector< TfTokenListFields () const
 Returns all fields with values. More...
 
SDF_API bool HasField (const TfToken &name) const
 
template<class T >
bool HasField (const TfToken &name, T *value) const
 
SDF_API VtValue GetField (const TfToken &name) const
 Returns a field value by name. More...
 
template<typename T >
T GetFieldAs (const TfToken &name, const T &defaultValue=T()) const
 
SDF_API bool SetField (const TfToken &name, const VtValue &value)
 Sets a field value as a boxed VtValue. More...
 
template<typename T >
bool SetField (const TfToken &name, const T &value)
 Sets a field value of type T. More...
 
SDF_API bool ClearField (const TfToken &name)
 Clears a field. More...
 
SDF_API bool operator== (const SdfSpec &rhs) const
 
SDF_API bool operator< (const SdfSpec &rhs) const
 

Static Public Member Functions

Spec construction
static SDF_API SdfVariantSpecHandle New (const SdfVariantSetSpecHandle &owner, const std::string &name)
 Constructs a new instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SdfSpec
bool _MoveSpec (const SdfPath &oldPath, const SdfPath &newPath) const
 
bool _DeleteSpec (const SdfPath &path)
 

Detailed Description

Represents a single variant in a variant set.

A variant contains a prim. This prim is the root prim of the variant.

SdfVariantSpecs are value objects. This means they are immutable once created and they are passed by copy-in APIs. To change a variant spec, you make a new one and replace the existing one.

Definition at line 55 of file variantSpec.h.

Member Function Documentation

SDF_API std::string SdfVariantSpec::GetName ( ) const

Returns the name of this variant.

SDF_API TfToken SdfVariantSpec::GetNameToken ( ) const

Returns the name of this variant.

SDF_API SdfVariantSetSpecHandle SdfVariantSpec::GetOwner ( ) const

Return the SdfVariantSetSpec that owns this variant.

SDF_API SdfPrimSpecHandle SdfVariantSpec::GetPrimSpec ( ) const

Get the prim spec owned by this variant.

SDF_API std::vector<std::string> SdfVariantSpec::GetVariantNames ( const std::string name) const

Returns list of variant names for the given variant set.

SDF_API SdfVariantSetsProxy SdfVariantSpec::GetVariantSets ( ) const

Returns the nested variant sets.

The result maps variant set names to variant sets. Variant sets may be removed through the proxy.

static SDF_API SdfVariantSpecHandle SdfVariantSpec::New ( const SdfVariantSetSpecHandle &  owner,
const std::string name 
)
static

Constructs a new instance.


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