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
58 static SdfAttributeSpecHandle
59 New(
const SdfPrimSpecHandle& owner,
205 bool HasSpline()
const;
229 std::set<double> ListTimeSamples()
const;
232 size_t GetNumTimeSamples()
const;
235 bool GetBracketingTimeSamples(
double time,
double* tLower,
236 double* tUpper)
const;
239 bool QueryTimeSample(
double time,
VtValue *value=NULL)
const;
244 bool QueryTimeSample(
double time, T* data)
const
247 return QueryTimeSample(time);
251 const bool hasValue = QueryTimeSample(
254 if (std::is_same<T, SdfValueBlock>::value) {
255 return hasValue && outValue.isValueBlock;
258 return hasValue && (!outValue.isValueBlock);
262 void SetTimeSample(
double time,
const VtValue & value);
267 void SetTimeSample(
double time,
const T& value)
271 return SetTimeSample(time, untypedInValue);
275 void EraseTimeSample(
double time);
292SdfAttributeSpecHandle
294 const SdfLayerHandle &layer,
298 bool isCustom =
false);
316 const SdfLayerHandle &layer,
320 bool isCustom =
false);
322PXR_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 bool HasArraySizeConstraint() const
Returns true if this attribute has an array size constraint value authored.
SDF_API void ClearLimits()
Clears the limits metadata for this 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 void SetSpline(const TsSpline &value)
Set the provided value as the spline for this attribute spec.
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 void SetArraySizeConstraint(int64_t constraint)
Sets the array size constraint value for this attribute.
SDF_API bool HasAllowedTokens() const
Returns true if allowed tokens metadata is set for this attribute.
SDF_API TsSpline GetSpline() const
Returns the TsSpline at this attribute spec if a spec exists, otherwise an empty spline is returned.
SDF_API SdfConnectionsProxy GetConnectionPathList() const
Returns a proxy for editing the attribute's connection paths.
SDF_API int64_t GetArraySizeConstraint() const
Returns the array size constraint value for this attribute.
SDF_API void ClearSpline()
Clear the spline from this attribute spec.
SDF_API void ClearAllowedTokens()
Clears the allowed tokens metadata for this attribute.
SDF_API void ClearArraySizeConstraint()
Clears the array size constraint value for this attribute.
SDF_API VtDictionary GetLimits() const
Returns the limits dictionary for this attribute.
SDF_API bool HasLimits() const
Returns true if limits metadata is set for this attribute.
SDF_API void SetLimits(const VtDictionary &limits)
Sets the limits dictionary 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.
A mathematical description of a curved function from time to value.
A map with string keys and VtValue values.
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.