All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
types.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_TYPES_H
8#define PXR_USD_SDF_TYPES_H
9
12
13#include "pxr/pxr.h"
14#include "pxr/usd/sdf/api.h"
17#include "pxr/usd/sdf/listOp.h"
18#include "pxr/usd/sdf/opaqueValue.h"
19#include "pxr/usd/sdf/pathExpression.h"
21#include "pxr/usd/sdf/valueTypeName.h"
22
26#include "pxr/base/gf/half.h"
30#include "pxr/base/gf/quatd.h"
31#include "pxr/base/gf/quatf.h"
32#include "pxr/base/gf/quath.h"
33#include "pxr/base/gf/vec2d.h"
34#include "pxr/base/gf/vec2f.h"
35#include "pxr/base/gf/vec2h.h"
36#include "pxr/base/gf/vec2i.h"
37#include "pxr/base/gf/vec3d.h"
38#include "pxr/base/gf/vec3f.h"
39#include "pxr/base/gf/vec3h.h"
40#include "pxr/base/gf/vec3i.h"
41#include "pxr/base/gf/vec4d.h"
42#include "pxr/base/gf/vec4f.h"
43#include "pxr/base/gf/vec4h.h"
44#include "pxr/base/gf/vec4i.h"
45#include "pxr/base/tf/enum.h"
46#include "pxr/base/tf/preprocessorUtilsLite.h"
48#include "pxr/base/tf/token.h"
49#include "pxr/base/tf/type.h"
50#include "pxr/base/vt/array.h"
52#include "pxr/base/vt/value.h"
53
54#include <iosfwd>
55#include <list>
56#include <map>
57#include <stdint.h>
58#include <string>
59#include <typeinfo>
60#include <vector>
61
62PXR_NAMESPACE_OPEN_SCOPE
63
64class SdfPath;
65
69 // The unknown type has a value of 0 so that SdfSpecType() is unknown.
70 SdfSpecTypeUnknown = 0,
71
72 // Real concrete types
73 SdfSpecTypeAttribute,
74 SdfSpecTypeConnection,
75 SdfSpecTypeExpression,
76 SdfSpecTypeMapper,
77 SdfSpecTypeMapperArg,
78 SdfSpecTypePrim,
79 SdfSpecTypePseudoRoot,
80 SdfSpecTypeRelationship,
81 SdfSpecTypeRelationshipTarget,
82 SdfSpecTypeVariant,
83 SdfSpecTypeVariantSet,
84
85 SdfNumSpecTypes
86};
87
101 SdfSpecifierDef,
102 SdfSpecifierOver,
103 SdfSpecifierClass,
104 SdfNumSpecifiers
105};
106
108inline
109bool
111{
112 return (spec != SdfSpecifierOver);
113}
114
133 SdfPermissionPublic,
134 SdfPermissionPrivate,
135
136 SdfNumPermissions
137};
138
157 SdfVariabilityVarying,
158 SdfVariabilityUniform,
159
160 SdfNumVariabilities
161};
162
163
178{
179 SdfAuthoringErrorUnrecognizedFields,
180 SdfAuthoringErrorUnrecognizedSpecType
181};
182
183// Each category of compatible units of measurement is defined by a
184// preprocessor sequence of tuples. Each such sequence gives rise to an enum
185// representing the corresponding unit category. All the unit categories are
186// listed in _SDF_UNITS where each entry is a two-tuple with the unit category
187// name as the first element, and the second element is the units in that
188// category. Each tuple in a unit category sequence corresponds to a unit of
189// measurement represented by an enumerant whose name is given by concatenating
190// 'Sdf', the unit category name, the word 'Unit' and the first entry in the
191// tuple. (E.g. units of category 'Length' are represented by an enum named
192// SdfLengthUnit with enumerants SdfLengthUnitInch, SdfLengthUnitMeter and so
193// forth.) The second element in the tuple is the display name for the unit,
194// and the third element is the relative size of the unit compared to the menv
195// default unit for the unit category (which has a relative size of 1.0).
196// Dimensionless quantities use a special 'Dimensionless' unit category
197// represented by the enum SdfDimensionlessUnit.
198#define _SDF_LENGTH_UNITS \
199((Millimeter, "mm", 0.001)) \
200((Centimeter, "cm", 0.01)) \
201((Decimeter, "dm", 0.1)) \
202((Meter, "m", 1.0)) \
203((Kilometer, "km", 1000.0)) \
204((Inch, "in", 0.0254)) \
205((Foot, "ft", 0.3048)) \
206((Yard, "yd", 0.9144)) \
207((Mile, "mi", 1609.344))
208
209#define _SDF_ANGULAR_UNITS \
210((Degrees, "deg", 1.0)) \
211((Radians, "rad", 57.2957795130823208768))
212
213#define _SDF_DIMENSIONLESS_UNITS \
214((Percent, "%", 0.01)) \
215((Default, "default", 1.0))
216
217#define _SDF_UNITS \
218((Length, _SDF_LENGTH_UNITS), \
219(Angular, _SDF_ANGULAR_UNITS), \
220(Dimensionless, _SDF_DIMENSIONLESS_UNITS))
221
222#define _SDF_UNIT_TAG(tup) TF_PP_TUPLE_ELEM(0, tup)
223#define _SDF_UNIT_NAME(tup) TF_PP_TUPLE_ELEM(1, tup)
224#define _SDF_UNIT_SCALE(tup) TF_PP_TUPLE_ELEM(2, tup)
225
226#define _SDF_UNITSLIST_CATEGORY(tup) TF_PP_TUPLE_ELEM(0, tup)
227#define _SDF_UNITSLIST_TUPLES(tup) TF_PP_TUPLE_ELEM(1, tup)
228#define _SDF_UNITSLIST_ENUM(elem) TF_PP_CAT(TF_PP_CAT(Sdf, \
229 _SDF_UNITSLIST_CATEGORY(elem)), Unit)
230
231#define _SDF_DECLARE_UNIT_ENUMERANT(tag, elem) \
232 TF_PP_CAT(Sdf ## tag ## Unit, _SDF_UNIT_TAG(elem)),
233
234#define _SDF_DECLARE_UNIT_ENUM(elem) \
235enum _SDF_UNITSLIST_ENUM(elem) { \
236 TF_PP_SEQ_FOR_EACH(_SDF_DECLARE_UNIT_ENUMERANT, \
237 _SDF_UNITSLIST_CATEGORY(elem), \
238 _SDF_UNITSLIST_TUPLES(elem)) \
239};
240
241#define _SDF_FOR_EACH_UNITS_IMPL(macro, ...) \
242 TF_PP_FOR_EACH(macro, __VA_ARGS__)
243#define _SDF_FOR_EACH_UNITS(macro, args) \
244 _SDF_FOR_EACH_UNITS_IMPL(macro, TF_PP_EAT_PARENS(args))
245
246// On Windows this call to _SDF_FOR_EACH_UNITS generates a C4003 warning.
247// This is harmless, but we disable the warning here so that external
248// projects that include this header don't run into it as well.
249ARCH_PRAGMA_PUSH
250ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
251_SDF_FOR_EACH_UNITS(_SDF_DECLARE_UNIT_ENUM, _SDF_UNITS)
252ARCH_PRAGMA_POP
253
255typedef std::map<std::string, VtValue> SdfMapperParametersMap;
256
258typedef std::map<std::string, std::string> SdfVariantSelectionMap;
259
261typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap;
262
264// Note: This map needs to be lexicographically sorted for some downstream
265// clients, so SdfPath::FastLessThan is explicitly omitted as
266// the Compare template parameter.
267typedef std::map<SdfPath, SdfPath> SdfRelocatesMap;
268
271typedef std::pair<SdfPath, SdfPath> SdfRelocate;
272
274typedef std::vector<SdfRelocate> SdfRelocates;
275
277typedef std::map<double, VtValue> SdfTimeSampleMap;
278
280SDF_API TfEnum SdfDefaultUnit( TfToken const &typeName );
281
283SDF_API const TfEnum &SdfDefaultUnit( const TfEnum &unit );
284
286SDF_API const std::string &SdfUnitCategory( const TfEnum &unit );
287
290SDF_API double SdfConvertUnit( const TfEnum &fromUnit, const TfEnum &toUnit );
291
293SDF_API const std::string &SdfGetNameForUnit( const TfEnum &unit );
294
296SDF_API const TfEnum &SdfGetUnitFromName( const std::string &name );
297
299SDF_API bool SdfValueHasValidType(VtValue const& value);
300
304
309
313
314// Sdf allows a specific set of types for attribute and metadata values.
315// These types and some additional metadata are listed in the preprocessor
316// sequence of tuples below. First element is a tag name that is appended to
317// 'SdfValueType' to produce the C++ traits type for the value type.
318// Second element is the value type name, third element is the corresponding
319// C++ type, and the fourth element is the tuple of tuple dimensions.
320//
321// Libraries may extend this list and define additional value types.
322// When doing so, the type must be declared using the SDF_DECLARE_VALUE_TYPE
323// macro below. The type must also be registered in the associated schema using
324// SdfSchema::_RegisterValueType(s).
325#define _SDF_SCALAR_VALUE_TYPES \
326 ((Bool, bool, bool, () )) \
327 ((UChar, uchar, unsigned char, () )) \
328 ((Int, int, int, () )) \
329 ((UInt, uint, unsigned int, () )) \
330 ((Int64, int64, int64_t, () )) \
331 ((UInt64, uint64, uint64_t, () )) \
332 ((Half, half, GfHalf, () )) \
333 ((Float, float, float, () )) \
334 ((Double, double, double, () )) \
335 ((TimeCode, timecode, SdfTimeCode, () )) \
336 ((String, string, std::string, () )) \
337 ((Token, token, TfToken, () )) \
338 ((Asset, asset, SdfAssetPath, () )) \
339 ((Opaque, opaque, SdfOpaqueValue, () )) \
340 ((PathExpression, pathExpression, SdfPathExpression, () ))
341
342#define _SDF_DIMENSIONED_VALUE_TYPES \
343 ((Matrix2d, matrix2d, GfMatrix2d, (2,2) )) \
344 ((Matrix3d, matrix3d, GfMatrix3d, (3,3) )) \
345 ((Matrix4d, matrix4d, GfMatrix4d, (4,4) )) \
346 ((Quath, quath, GfQuath, (4) )) \
347 ((Quatf, quatf, GfQuatf, (4) )) \
348 ((Quatd, quatd, GfQuatd, (4) )) \
349 ((Int2, int2, GfVec2i, (2) )) \
350 ((Half2, half2, GfVec2h, (2) )) \
351 ((Float2, float2, GfVec2f, (2) )) \
352 ((Double2, double2, GfVec2d, (2) )) \
353 ((Int3, int3, GfVec3i, (3) )) \
354 ((Half3, half3, GfVec3h, (3) )) \
355 ((Float3, float3, GfVec3f, (3) )) \
356 ((Double3, double3, GfVec3d, (3) )) \
357 ((Int4, int4, GfVec4i, (4) )) \
358 ((Half4, half4, GfVec4h, (4) )) \
359 ((Float4, float4, GfVec4f, (4) )) \
360 ((Double4, double4, GfVec4d, (4) ))
361
362#define SDF_VALUE_TYPES _SDF_SCALAR_VALUE_TYPES _SDF_DIMENSIONED_VALUE_TYPES
363
364// Accessors for individual elements in the value types tuples.
365#define SDF_VALUE_CPP_TYPE(tup) TF_PP_TUPLE_ELEM(2, tup)
366#define SDF_VALUE_CPP_ARRAY_TYPE(tup) VtArray<TF_PP_TUPLE_ELEM(2, tup)>
367
368template <class T>
369struct SdfValueTypeTraits {
370 static const bool IsValueType = false;
371};
372
373// Allow character arrays to be treated as Sdf value types.
374// Sdf converts character arrays to strings for scene description.
375template <int N>
376struct SdfValueTypeTraits<char[N]> {
377 static const bool IsValueType = true;
378};
379
380#define SDF_DECLARE_VALUE_TYPE_TRAITS(unused, elem) \
381template <> \
382struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
383 static const bool IsValueType = true; \
384}; \
385template <> \
386struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
387 static const bool IsValueType = true; \
388};
389
390TF_PP_SEQ_FOR_EACH(SDF_DECLARE_VALUE_TYPE_TRAITS, ~, SDF_VALUE_TYPES);
391
413SDF_API
414bool
416
417#define SDF_VALUE_ROLE_NAME_TOKENS \
418 (Point) \
419 (Normal) \
420 (Vector) \
421 (Color) \
422 (Frame) \
423 (Transform) \
424 (PointIndex) \
425 (EdgeIndex) \
426 (FaceIndex) \
427 (Group) \
428 (TextureCoordinate)
429
430TF_DECLARE_PUBLIC_TOKENS(SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS);
431
432SDF_DECLARE_HANDLES(SdfLayer);
433
434SDF_DECLARE_HANDLES(SdfAttributeSpec);
435SDF_DECLARE_HANDLES(SdfPrimSpec);
436SDF_DECLARE_HANDLES(SdfPropertySpec);
437SDF_DECLARE_HANDLES(SdfSpec);
438SDF_DECLARE_HANDLES(SdfRelationshipSpec);
439SDF_DECLARE_HANDLES(SdfVariantSetSpec);
440SDF_DECLARE_HANDLES(SdfVariantSpec);
441
442typedef std::map<std::string, SdfVariantSetSpecHandle>
443 SdfVariantSetSpecHandleMap;
444
446SDF_API
447std::ostream & operator<<( std::ostream &out, const SdfSpecifier &spec );
448
450SDF_API
451std::ostream & operator<<( std::ostream &out,
452 const SdfRelocatesMap &reloMap );
453
455SDF_API
456std::ostream & operator<<( std::ostream &out,
457 const SdfRelocates &relocates );
458
460SDF_API
461std::ostream & operator<<( std::ostream &out,
462 const SdfTimeSampleMap &sampleMap );
463
464SDF_API
465std::ostream &VtStreamOut(const SdfVariantSelectionMap &, std::ostream &);
466
476{
477public:
480
482 SDF_API explicit SdfUnregisteredValue(const std::string &value);
483
485 SDF_API explicit SdfUnregisteredValue(const VtDictionary &value);
486
488 SDF_API explicit SdfUnregisteredValue(const SdfUnregisteredValueListOp &value);
489
491 const VtValue& GetValue() const {
492 return _value;
493 }
494
496 friend size_t hash_value(const SdfUnregisteredValue &uv) {
497 return uv._value.GetHash();
498 }
499
501 SDF_API bool operator==(const SdfUnregisteredValue &other) const;
502
504 SDF_API bool operator!=(const SdfUnregisteredValue &other) const;
505
506private:
507 VtValue _value;
508};
509
511SDF_API std::ostream &operator << (std::ostream &out, const SdfUnregisteredValue &value);
512
513class Sdf_ValueTypeNamesType {
514 Sdf_ValueTypeNamesType(const Sdf_ValueTypeNamesType&) = delete;
515 Sdf_ValueTypeNamesType& operator=(const Sdf_ValueTypeNamesType&) = delete;
516public:
517 SdfValueTypeName Bool;
518 SdfValueTypeName UChar, Int, UInt, Int64, UInt64;
519 SdfValueTypeName Half, Float, Double, TimeCode;
520 SdfValueTypeName String, Token, Asset;
521 SdfValueTypeName Int2, Int3, Int4;
522 SdfValueTypeName Half2, Half3, Half4;
523 SdfValueTypeName Float2, Float3, Float4;
524 SdfValueTypeName Double2, Double3, Double4;
525 SdfValueTypeName Point3h, Point3f, Point3d;
526 SdfValueTypeName Vector3h, Vector3f, Vector3d;
527 SdfValueTypeName Normal3h, Normal3f, Normal3d;
528 SdfValueTypeName Color3h, Color3f, Color3d;
529 SdfValueTypeName Color4h, Color4f, Color4d;
530 SdfValueTypeName Quath, Quatf, Quatd;
531 SdfValueTypeName Matrix2d, Matrix3d, Matrix4d;
532 SdfValueTypeName Frame4d;
533 SdfValueTypeName TexCoord2h, TexCoord2f, TexCoord2d;
534 SdfValueTypeName TexCoord3h, TexCoord3f, TexCoord3d;
535 SdfValueTypeName Opaque;
536 SdfValueTypeName Group;
537 SdfValueTypeName PathExpression;
538
539 SdfValueTypeName BoolArray;
540 SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
541 SdfValueTypeName HalfArray, FloatArray, DoubleArray, TimeCodeArray;
542 SdfValueTypeName StringArray, TokenArray, AssetArray;
543 SdfValueTypeName Int2Array, Int3Array, Int4Array;
544 SdfValueTypeName Half2Array, Half3Array, Half4Array;
545 SdfValueTypeName Float2Array, Float3Array, Float4Array;
546 SdfValueTypeName Double2Array, Double3Array, Double4Array;
547 SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
548 SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
549 SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
550 SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
551 SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
552 SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
553 SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
554 SdfValueTypeName Frame4dArray;
555 SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
556 SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
557 SdfValueTypeName PathExpressionArray;
558
559 SDF_API ~Sdf_ValueTypeNamesType();
560 struct _Init {
561 SDF_API static const Sdf_ValueTypeNamesType* New();
562 };
563
564 // For Pixar internal backwards compatibility.
565 TfToken GetSerializationName(const SdfValueTypeName&) const;
566 TfToken GetSerializationName(const VtValue&) const;
567 TfToken GetSerializationName(const TfToken&) const;
568
569private:
570 friend const Sdf_ValueTypeNamesType* Sdf_InitializeValueTypeNames();
571 Sdf_ValueTypeNamesType();
572};
573
574extern SDF_API TfStaticData<const Sdf_ValueTypeNamesType,
575 Sdf_ValueTypeNamesType::_Init> SdfValueTypeNames;
576
592 bool operator==(const SdfValueBlock& block) const { return true; }
593 bool operator!=(const SdfValueBlock& block) const { return false; }
594
595private:
596 friend inline size_t hash_value(const SdfValueBlock &block) { return 0; }
597};
598
599// Write out the string representation of a block.
600SDF_API std::ostream& operator<<(std::ostream&, SdfValueBlock const&);
601
602// A class that represents a human-readable value. This is used for the special
603// purpose of producing layers that serialize field values in alternate ways; to
604// produce more human-readable output, for example.
605struct SdfHumanReadableValue {
606 SdfHumanReadableValue() = default;
607 explicit SdfHumanReadableValue(std::string const &text) : _text(text) {}
608
609 bool operator==(SdfHumanReadableValue const &other) const {
610 return GetText() == other.GetText();
611 }
612 bool operator!=(SdfHumanReadableValue const &other) const {
613 return !(*this == other);
614 }
615
616 std::string const &GetText() const { return _text; }
617private:
618 std::string _text;
619};
620
621SDF_API
622std::ostream &operator<<(std::ostream &out, const SdfHumanReadableValue &hrval);
623
624SDF_API
625size_t hash_value(const SdfHumanReadableValue &hrval);
626
627PXR_NAMESPACE_CLOSE_SCOPE
628
629#endif // PXR_USD_SDF_TYPES_H
A subclass of SdfPropertySpec that holds typed data.
Definition: attributeSpec.h:40
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:84
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a prim description in an SdfLayer object.
Definition: primSpec.h:58
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:43
A property that contains a reference to one or more SdfPrimSpec instances.
Base class for all Sdf spec classes.
Definition: spec.h:33
Stores a representation of the value for an unregistered metadata field encountered during text layer...
Definition: types.h:476
const VtValue & GetValue() const
Returns the wrapped VtValue specified in the constructor.
Definition: types.h:491
SDF_API bool operator==(const SdfUnregisteredValue &other) const
Returns true if the wrapped VtValues are equal.
SDF_API SdfUnregisteredValue()
Wraps an empty VtValue.
SDF_API SdfUnregisteredValue(const SdfUnregisteredValueListOp &value)
Wraps a SdfUnregisteredValueListOp.
SDF_API bool operator!=(const SdfUnregisteredValue &other) const
Returns true if the wrapped VtValues are not equal.
friend size_t hash_value(const SdfUnregisteredValue &uv)
Hash.
Definition: types.h:496
SDF_API SdfUnregisteredValue(const VtDictionary &value)
Wraps a VtDictionary.
SDF_API SdfUnregisteredValue(const std::string &value)
Wraps a std::string.
Represents a value type name, i.e.
Definition: valueTypeName.h:71
Represents a coherent set of alternate representations for part of a scene.
Represents a single variant in a variant set.
Definition: variantSpec.h:39
An enum class that records both enum type and enum value.
Definition: enum.h:120
Create or return a previously created object instance of global data.
Definition: staticData.h:96
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
A map with string keys and VtValue values.
Definition: dictionary.h:43
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
VT_API size_t GetHash() const
Return a hash code for the held object by calling VtHashValue() on it.
Demangle C++ typenames generated by the typeid() facility.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
This header serves to simply bring in the half float datatype and provide a hash_value function.
size_t hash_value(const half h)
Overload hash_value for half.
Definition: half.h:28
Define integral types.
Pragmas for controlling compiler-specific behaviors.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition: types.h:591
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
SDF_API TfType SdfGetTypeForValueTypeName(TfToken const &name)
Given an sdf valueType name, produce TfType if the type name specifies a valid sdf value type.
SdfAuthoringError
An enum for TfError codes related to authoring operations.
Definition: types.h:178
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:68
SDF_API bool SdfValueHasValidType(VtValue const &value)
Given a value, returns if there is a valid corresponding valueType.
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
Definition: types.h:100
SDF_API const std::string & SdfUnitCategory(const TfEnum &unit)
Gets the unit category for a given /a unit.
SDF_API TfToken SdfGetRoleNameForValueTypeName(TfToken const &typeName)
Return role name for typeName.
std::pair< SdfPath, SdfPath > SdfRelocate
A single relocate specifying a source SdfPath and a target SdfPath for a relocation.
Definition: types.h:271
std::map< std::string, std::vector< std::string > > SdfVariantsMap
A map of variant set names to list of variants in those sets.
Definition: types.h:261
ARCH_PRAGMA_PUSH ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS ARCH_PRAGMA_POP typedef std::map< std::string, VtValue > SdfMapperParametersMap
A map of mapper parameter names to parameter values.
Definition: types.h:255
SDF_API double SdfConvertUnit(const TfEnum &fromUnit, const TfEnum &toUnit)
Converts from one unit of measure to another.
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:156
SDF_API TfEnum SdfDefaultUnit(TfToken const &typeName)
Gets the show default unit for the given /a typeName.
std::map< std::string, std::string > SdfVariantSelectionMap
A map of reference variant set names to variants in those sets.
Definition: types.h:258
SDF_API SdfValueTypeName SdfGetValueTypeNameForValue(VtValue const &value)
Given a value, produce the sdf valueType name.
std::vector< SdfRelocate > SdfRelocates
A vector of relocation source path to target path pairs.
Definition: types.h:274
SDF_API const std::string & SdfGetNameForUnit(const TfEnum &unit)
Gets the name for a given /a unit.
SdfPermission
An enum that defines permission levels.
Definition: types.h:132
bool SdfIsDefiningSpecifier(SdfSpecifier spec)
Returns true if the specifier defines a prim.
Definition: types.h:110
SDF_API bool SdfConvertToValidMetadataDictionary(VtDictionary *dict, std::string *errMsg)
Convert dict to a valid metadata dictionary for scene description.
SDF_API const TfEnum & SdfGetUnitFromName(const std::string &name)
Gets a unit for the given /a name.
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:267
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:277