7#ifndef PXR_USD_SDF_ATTRIBUTE_SPEC_H
8#define PXR_USD_SDF_ATTRIBUTE_SPEC_H
13#include "pxr/usd/sdf/api.h"
14#include "pxr/usd/sdf/declareSpec.h"
15#include "pxr/usd/sdf/path.h"
20PXR_NAMESPACE_OPEN_SCOPE
56 static SdfAttributeSpecHandle
57 New(
const SdfPrimSpecHandle& owner,
159 std::set<double> ListTimeSamples()
const;
162 size_t GetNumTimeSamples()
const;
165 bool GetBracketingTimeSamples(
double time,
double* tLower,
166 double* tUpper)
const;
169 bool QueryTimeSample(
double time,
VtValue *value=NULL)
const;
174 bool QueryTimeSample(
double time, T* data)
const
177 return QueryTimeSample(time);
181 const bool hasValue = QueryTimeSample(
184 if (std::is_same<T, SdfValueBlock>::value) {
185 return hasValue && outValue.isValueBlock;
188 return hasValue && (!outValue.isValueBlock);
192 void SetTimeSample(
double time,
const VtValue & value);
197 void SetTimeSample(
double time,
const T& value)
201 return SetTimeSample(time, untypedInValue);
205 void EraseTimeSample(
double time);
222SdfAttributeSpecHandle
224 const SdfLayerHandle &layer,
228 bool isCustom =
false);
246 const SdfLayerHandle &layer,
250 bool isCustom =
false);
252PXR_NAMESPACE_CLOSE_SCOPE
SDF_API SdfAttributeSpecHandle SdfCreatePrimAttributeInLayer(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...
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...
The fully-typed container for a field value in an SdfAbstractData.
A type-erased container for a const field value in an SdfAbstractData.
The fully-typed container for a field value in an SdfAbstractData.
A type-erased container for a field value in an SdfAbstractData.
A subclass of SdfPropertySpec that holds typed data.
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.
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Represents a value type name, i.e.
An enum class that records both enum type and enum value.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
SdfVariability
An enum that identifies variability types for attributes.
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.