Loading...
Searching...
No Matches
attributeSpec.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_SDF_ATTRIBUTE_SPEC_H
8#define PXR_USD_SDF_ATTRIBUTE_SPEC_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/sdf/api.h"
14#include "pxr/usd/sdf/declareSpec.h"
15#include "pxr/usd/sdf/path.h"
17#include "pxr/usd/sdf/types.h"
18#include "pxr/base/tf/enum.h"
19
20PXR_NAMESPACE_OPEN_SCOPE
21
40{
41 SDF_DECLARE_SPEC(SdfAttributeSpec, SdfPropertySpec);
42
43public:
44 typedef SdfAttributeSpec This;
45 typedef SdfPropertySpec Parent;
46
50
55 SDF_API
56 static SdfAttributeSpecHandle
57 New(const SdfPrimSpecHandle& owner,
58 const std::string& name, const SdfValueTypeName& typeName,
59 SdfVariability variability = SdfVariabilityVarying,
60 bool custom = false);
61
63
66
71 SDF_API
73
75 SDF_API
76 bool HasConnectionPaths() const;
77
79 SDF_API
81
85
91 SDF_API
92 VtTokenArray GetAllowedTokens() const;
93
95 SDF_API
96 void SetAllowedTokens(const VtTokenArray& allowedTokens);
97
99 SDF_API
100 bool HasAllowedTokens() const;
101
103 SDF_API
105
107 SDF_API
109
111 SDF_API
112 void SetDisplayUnit(const TfEnum& displayUnit);
113
115 SDF_API
116 bool HasDisplayUnit() const;
117
119 SDF_API
121
124 SDF_API
126
129 SDF_API
130 void SetColorSpace(const TfToken &colorSpace);
131
133 SDF_API
134 bool HasColorSpace() const;
135
137 SDF_API
139
143
147 SDF_API
149
151};
152
163SDF_API
164bool
166 const SdfLayerHandle &layer,
167 const SdfPath &attrPath,
168 const SdfValueTypeName &typeName,
169 SdfVariability variability = SdfVariabilityVarying,
170 bool isCustom = false);
171
172PXR_NAMESPACE_CLOSE_SCOPE
173
174#endif // PXR_USD_SDF_ATTRIBUTE_SPEC_H
SDF_API bool SdfJustCreatePrimAttributeInLayer(const SdfLayerHandle &layer, const SdfPath &attrPath, const SdfValueTypeName &typeName, SdfVariability variability=SdfVariabilityVarying, bool isCustom=false)
Convenience function to create an attributeSpec on a primSpec at the given path, and any necessary pa...
A subclass of SdfPropertySpec that holds typed data.
Definition: attributeSpec.h:40
SDF_API void SetAllowedTokens(const VtTokenArray &allowedTokens)
Sets the allowed tokens metadata for this attribute.
SDF_API bool HasDisplayUnit() const
Returns true if a display unit is set for this attribute.
SDF_API void SetDisplayUnit(const TfEnum &displayUnit)
Sets the display unit of the attribute.
SDF_API void ClearConnectionPaths()
Clears the connection paths for this attribute.
SDF_API void SetColorSpace(const TfToken &colorSpace)
Sets the color-space in which a color or texture valued attribute is authored.
SDF_API TfToken GetRoleName() const
Returns the roleName for this attribute's typeName.
SDF_API TfToken GetColorSpace() const
Returns the color-space in which a color or texture valued attribute is authored.
SDF_API void ClearDisplayUnit()
Clears the display unit of the attribute.
SDF_API bool HasConnectionPaths() const
Returns true if any connection paths are set on this attribute.
SDF_API VtTokenArray GetAllowedTokens() const
Returns the allowed tokens metadata for this attribute.
static SDF_API SdfAttributeSpecHandle New(const SdfPrimSpecHandle &owner, const std::string &name, const SdfValueTypeName &typeName, SdfVariability variability=SdfVariabilityVarying, bool custom=false)
Constructs a new prim attribute instance.
SDF_API bool HasAllowedTokens() const
Returns true if allowed tokens metadata is set for this attribute.
SDF_API SdfConnectionsProxy GetConnectionPathList() const
Returns a proxy for editing the attribute's connection paths.
SDF_API void ClearAllowedTokens()
Clears the allowed tokens metadata for this attribute.
SDF_API TfEnum GetDisplayUnit() const
Returns the display unit of the attribute.
SDF_API void ClearColorSpace()
Clears the colorSpace metadata value set on this attribute.
SDF_API bool HasColorSpace() const
Returns true if this attribute has a colorSpace value authored.
Represents a set of list editing operations.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:43
Represents a value type name, i.e.
Definition: valueTypeName.h:71
An enum class that records both enum type and enum value.
Definition: enum.h:120
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Basic Sdf data types.
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:156