HDK
|
#include <propertySpec.h>
Public Member Functions | |
Ownership | |
SDF_API SdfSpecHandle | GetOwner () const |
Returns the owner prim or relationship of this property. More... | |
Metadata | |
SDF_API SdfDictionaryProxy | GetCustomData () const |
SDF_API SdfDictionaryProxy | GetAssetInfo () const |
SDF_API void | SetCustomData (const std::string &name, const VtValue &value) |
SDF_API void | SetAssetInfo (const std::string &name, const VtValue &value) |
SDF_API std::string | GetDisplayGroup () const |
SDF_API void | SetDisplayGroup (const std::string &value) |
Sets the displayGroup string for this property spec. More... | |
SDF_API std::string | GetDisplayName () const |
SDF_API void | SetDisplayName (const std::string &value) |
Sets the displayName string for this property spec. More... | |
SDF_API std::string | GetDocumentation () const |
SDF_API void | SetDocumentation (const std::string &value) |
Sets the documentation string for this property spec. More... | |
SDF_API bool | GetHidden () const |
SDF_API void | SetHidden (bool value) |
Sets whether this property spec will be hidden in browsers. More... | |
SDF_API SdfPermission | GetPermission () const |
SDF_API void | SetPermission (SdfPermission value) |
Sets the property's permission restriction. More... | |
SDF_API std::string | GetPrefix () const |
SDF_API void | SetPrefix (const std::string &value) |
Sets the prefix string for this property spec. More... | |
SDF_API std::string | GetSuffix () const |
SDF_API void | SetSuffix (const std::string &value) |
Sets the suffix string for this property spec. More... | |
SDF_API std::string | GetSymmetricPeer () const |
SDF_API void | SetSymmetricPeer (const std::string &peerName) |
SDF_API SdfDictionaryProxy | GetSymmetryArguments () const |
SDF_API void | SetSymmetryArgument (const std::string &name, const VtValue &value) |
SDF_API TfToken | GetSymmetryFunction () const |
SDF_API void | SetSymmetryFunction (const TfToken &functionName) |
Property value API | |
SDF_API SdfTimeSampleMap | GetTimeSampleMap () const |
Returns the entire set of time samples. More... | |
SDF_API TfType | GetValueType () const |
Returns the TfType representing the value type this property holds. More... | |
SDF_API SdfValueTypeName | GetTypeName () const |
SDF_API VtValue | GetDefaultValue () const |
SDF_API bool | SetDefaultValue (const VtValue &defaultValue) |
SDF_API bool | HasDefaultValue () const |
Returns true if a default value is set for this attribute. More... | |
SDF_API void | ClearDefaultValue () |
Clear the attribute's default value. More... | |
Public Member Functions inherited from SdfSpec | |
SDF_API SdfSpec & | operator= (const SdfSpec &other) |
SDF_API | ~SdfSpec () |
SDF_API const SdfSchemaBase & | GetSchema () 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< TfToken > | ListInfoKeys () const |
SDF_API std::vector< TfToken > | GetMetaDataInfoKeys () 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 VtValue & | GetFallbackForInfo (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< TfToken > | ListFields () 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 |
Name | |
SDF_API const std::string & | GetName () const |
Returns the property's name. More... | |
SDF_API TfToken | GetNameToken () const |
Returns the property's name, as a token. More... | |
SDF_API bool | CanSetName (const std::string &newName, std::string *whyNot) const |
SDF_API bool | SetName (const std::string &newName, bool validate=true) |
static SDF_API bool | IsValidName (const std::string &name) |
Spec properties | |
SDF_API std::string | GetComment () const |
SDF_API void | SetComment (const std::string &value) |
Sets the comment string for this property spec. More... | |
SDF_API bool | IsCustom () const |
Returns true if this spec declares a custom property. More... | |
SDF_API void | SetCustom (bool custom) |
Sets whether this spec declares a custom property. More... | |
SDF_API SdfVariability | GetVariability () const |
SDF_API bool | HasOnlyRequiredFields () const |
Additional Inherited Members | |
Protected Member Functions inherited from SdfSpec | |
bool | _MoveSpec (const SdfPath &oldPath, const SdfPath &newPath) const |
bool | _DeleteSpec (const SdfPath &path) |
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Scene Spec Attributes (SdfAttributeSpec) and Relationships (SdfRelationshipSpec) are the basic properties that make up Scene Spec Prims (SdfPrimSpec). They share many qualities and can sometimes be treated uniformly. The common qualities are provided by this base class.
NOTE: Do not use Python reserved words and keywords as attribute names. This will cause attribute resolution to fail.
Definition at line 59 of file propertySpec.h.
SDF_API bool SdfPropertySpec::CanSetName | ( | const std::string & | newName, |
std::string * | whyNot | ||
) | const |
Returns true if setting the property spec's name to newName
will succeed.
Returns false if it won't, and sets whyNot
with a string describing why not.
SDF_API SdfDictionaryProxy SdfPropertySpec::GetAssetInfo | ( | ) | const |
Returns the asset info dictionary for this property.
The default value is an empty dictionary.
The asset info dictionary is used to annotate SdfAssetPath-valued attributes pointing to the root-prims of assets (generally organized as models) with various data related to asset management. For example, asset name, root layer identifier, asset version etc.
SDF_API std::string SdfPropertySpec::GetComment | ( | ) | const |
Returns the comment string for this property spec.
The default value for comment is "".
SDF_API SdfDictionaryProxy SdfPropertySpec::GetCustomData | ( | ) | const |
Returns the property's custom data.
The default value for custom data is an empty dictionary.
Custom data is for use by plugins or other non-tools supplied extensions that need to be able to store data attached to arbitrary scene objects. Note that if the only objects you want to store data on are prims, using custom attributes is probably a better choice. But if you need to possibly store this data on attributes or relationships or as annotations on reference arcs, then custom data is an appropriate choice.
Returns the attribute's default value.
If it doesn't have a default value, an empty VtValue is returned.
SDF_API std::string SdfPropertySpec::GetDisplayGroup | ( | ) | const |
Returns the displayGroup string for this property spec.
The default value for displayGroup is empty string.
SDF_API std::string SdfPropertySpec::GetDisplayName | ( | ) | const |
Returns the displayName string for this property spec.
The default value for displayName is empty string.
SDF_API std::string SdfPropertySpec::GetDocumentation | ( | ) | const |
Returns the documentation string for this property spec.
The default value for documentation is empty string.
SDF_API bool SdfPropertySpec::GetHidden | ( | ) | const |
Returns whether this property spec will be hidden in browsers.
The default value for hidden is false.
SDF_API const std::string& SdfPropertySpec::GetName | ( | ) | const |
Returns the property's name.
SDF_API SdfSpecHandle SdfPropertySpec::GetOwner | ( | ) | const |
Returns the owner prim or relationship of this property.
SDF_API SdfPermission SdfPropertySpec::GetPermission | ( | ) | const |
Returns the property's permission restriction.
The default value for permission is SdfPermissionPublic.
SDF_API std::string SdfPropertySpec::GetPrefix | ( | ) | const |
Returns the prefix string for this property spec.
The default value for prefix is "".
SDF_API std::string SdfPropertySpec::GetSuffix | ( | ) | const |
Returns the suffix string for this property spec.
The default value for suffix is "".
SDF_API std::string SdfPropertySpec::GetSymmetricPeer | ( | ) | const |
Returns the property's symmetric peer.
The default value for the symmetric peer is an empty string.
SDF_API SdfDictionaryProxy SdfPropertySpec::GetSymmetryArguments | ( | ) | const |
Returns the property's symmetry arguments.
The default value for symmetry arguments is an empty dictionary.
Returns the property's symmetry function.
The default value for the symmetry function is an empty token.
SDF_API SdfTimeSampleMap SdfPropertySpec::GetTimeSampleMap | ( | ) | const |
Returns the entire set of time samples.
SDF_API SdfValueTypeName SdfPropertySpec::GetTypeName | ( | ) | const |
Returns the name of the value type that this property holds.
Returns the typename used to represent the types of value held by this attribute.
Returns the TfType representing the value type this property holds.
SDF_API SdfVariability SdfPropertySpec::GetVariability | ( | ) | const |
Returns the variability of the property.
An attribute's variability may be Varying
(the default), Uniform
, Config
, or Computed
.
A relationship's variability may be Varying
or Uniform
(the default)
Varying
attributes may be directly authored, animated and affected by Actions
. They are the most flexible. Varying relationships can have a default and an anim spline, in addition to a list of targets.
Uniform
attributes may be authored only with non-animated values (default values). They cannot be affected by Actions
, but they can be connected to other Uniform attributes. Uniform relationships have a list of targets but do not have default or anim spline values.
Config
attributes are the same as Uniform except that a Prim can choose to alter its collection of built-in properties based on the values of its Config attributes.
Computed
attributes may not be authored in scene description. Prims determine the values of their Computed attributes through Prim-specific computation. They may not be connected. SDF_API bool SdfPropertySpec::HasDefaultValue | ( | ) | const |
Returns true if a default value is set for this attribute.
SDF_API bool SdfPropertySpec::HasOnlyRequiredFields | ( | ) | const |
Returns true if this PropertySpec has no significant data other than just what is necessary for instantiation.
For example, "double foo" has only required fields, but "double foo = 3" has more than just what is required.
This is similar to IsInert except that IsInert will always return false even for properties that have only required fields; PropertySpecs are never considered inert because even a spec with only required fields will cause instantiation of on-demand properties.
SDF_API bool SdfPropertySpec::IsCustom | ( | ) | const |
Returns true if this spec declares a custom property.
|
static |
Returns true if the given name is considered a valid name for a property. A valid name is not empty, and does not use invalid characters (such as '/', '[', or '.').
SDF_API void SdfPropertySpec::SetAssetInfo | ( | const std::string & | name, |
const VtValue & | value | ||
) |
Sets a asset info entry for this property.
If value
is empty, then this removes the given asset info entry.
SDF_API void SdfPropertySpec::SetComment | ( | const std::string & | value | ) |
Sets the comment string for this property spec.
Sets whether this spec declares a custom property.
SDF_API void SdfPropertySpec::SetCustomData | ( | const std::string & | name, |
const VtValue & | value | ||
) |
Sets a property custom data entry.
If value
is empty, then this removes the given custom data entry.
Sets the attribute's default value.
Returns true if successful, false otherwise. Fails if defaultValue
has wrong type.
SDF_API void SdfPropertySpec::SetDisplayGroup | ( | const std::string & | value | ) |
Sets the displayGroup string for this property spec.
SDF_API void SdfPropertySpec::SetDisplayName | ( | const std::string & | value | ) |
Sets the displayName string for this property spec.
SDF_API void SdfPropertySpec::SetDocumentation | ( | const std::string & | value | ) |
Sets the documentation string for this property spec.
Sets whether this property spec will be hidden in browsers.
SDF_API bool SdfPropertySpec::SetName | ( | const std::string & | newName, |
bool | validate = true |
||
) |
Sets the property's name.
A Prim's properties must be unique by name. Setting the name to the same name as an existing property is an error.
Setting validate
to false, will skip validation of the newName (that is, CanSetName will not be called).
SDF_API void SdfPropertySpec::SetPermission | ( | SdfPermission | value | ) |
Sets the property's permission restriction.
SDF_API void SdfPropertySpec::SetPrefix | ( | const std::string & | value | ) |
Sets the prefix string for this property spec.
SDF_API void SdfPropertySpec::SetSuffix | ( | const std::string & | value | ) |
Sets the suffix string for this property spec.
SDF_API void SdfPropertySpec::SetSymmetricPeer | ( | const std::string & | peerName | ) |
Sets the property's symmetric peer.
If peerName
is empty, then this removes any symmetric peer for the given property.
SDF_API void SdfPropertySpec::SetSymmetryArgument | ( | const std::string & | name, |
const VtValue & | value | ||
) |
Sets a property symmetry argument.
If value
is empty, then this removes the argument with the given name
.
Sets the property's symmetry function.
If functionName
is empty, then this removes any symmetry function for the given property.