Loading...
Searching...
No Matches
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
27#include "pxr/base/gf/half.h"
31#include "pxr/base/gf/quatd.h"
32#include "pxr/base/gf/quatf.h"
33#include "pxr/base/gf/quath.h"
35#include "pxr/base/gf/vec2d.h"
36#include "pxr/base/gf/vec2f.h"
37#include "pxr/base/gf/vec2h.h"
38#include "pxr/base/gf/vec2i.h"
39#include "pxr/base/gf/vec3d.h"
40#include "pxr/base/gf/vec3f.h"
41#include "pxr/base/gf/vec3h.h"
42#include "pxr/base/gf/vec3i.h"
43#include "pxr/base/gf/vec4d.h"
44#include "pxr/base/gf/vec4f.h"
45#include "pxr/base/gf/vec4h.h"
46#include "pxr/base/gf/vec4i.h"
47#include "pxr/base/tf/enum.h"
48#include "pxr/base/tf/preprocessorUtilsLite.h"
50#include "pxr/base/tf/token.h"
51#include "pxr/base/tf/type.h"
52#include "pxr/base/vt/array.h"
55#include "pxr/base/vt/traits.h"
56#include "pxr/base/vt/value.h"
57#include "pxr/base/vt/valueTransform.h"
58
59#include <iosfwd>
60#include <list>
61#include <map>
62#include <stdint.h>
63#include <string>
64#include <typeinfo>
65#include <vector>
66
67PXR_NAMESPACE_OPEN_SCOPE
68
69class SdfPath;
70
74 // The unknown type has a value of 0 so that SdfSpecType() is unknown.
75 SdfSpecTypeUnknown = 0,
76
77 // Real concrete types
78 SdfSpecTypeAttribute,
79 SdfSpecTypeConnection,
80 SdfSpecTypeExpression,
81 SdfSpecTypeMapper,
82 SdfSpecTypeMapperArg,
83 SdfSpecTypePrim,
84 SdfSpecTypePseudoRoot,
85 SdfSpecTypeRelationship,
86 SdfSpecTypeRelationshipTarget,
87 SdfSpecTypeVariant,
88 SdfSpecTypeVariantSet,
89
90 SdfNumSpecTypes
91};
92
106 SdfSpecifierDef,
107 SdfSpecifierOver,
108 SdfSpecifierClass,
109 SdfNumSpecifiers
110};
111
113inline
114bool
116{
117 return (spec != SdfSpecifierOver);
118}
119
138 SdfPermissionPublic,
139 SdfPermissionPrivate,
140
141 SdfNumPermissions
142};
143
162 SdfVariabilityVarying,
163 SdfVariabilityUniform,
164
165 SdfNumVariabilities
166};
167
168
183{
184 SdfAuthoringErrorUnrecognizedFields,
185 SdfAuthoringErrorUnrecognizedSpecType
186};
187
188// Each category of compatible units of measurement is defined by a
189// preprocessor sequence of tuples. Each such sequence gives rise to an enum
190// representing the corresponding unit category. All the unit categories are
191// listed in _SDF_UNITS where each entry is a two-tuple with the unit category
192// name as the first element, and the second element is the units in that
193// category. Each tuple in a unit category sequence corresponds to a unit of
194// measurement represented by an enumerant whose name is given by concatenating
195// 'Sdf', the unit category name, the word 'Unit' and the first entry in the
196// tuple. (E.g. units of category 'Length' are represented by an enum named
197// SdfLengthUnit with enumerants SdfLengthUnitInch, SdfLengthUnitMeter and so
198// forth.) The second element in the tuple is the display name for the unit,
199// and the third element is the relative size of the unit compared to the menv
200// default unit for the unit category (which has a relative size of 1.0).
201// Dimensionless quantities use a special 'Dimensionless' unit category
202// represented by the enum SdfDimensionlessUnit.
203#define _SDF_LENGTH_UNITS \
204((Millimeter, "mm", 0.001)) \
205((Centimeter, "cm", 0.01)) \
206((Decimeter, "dm", 0.1)) \
207((Meter, "m", 1.0)) \
208((Kilometer, "km", 1000.0)) \
209((Inch, "in", 0.0254)) \
210((Foot, "ft", 0.3048)) \
211((Yard, "yd", 0.9144)) \
212((Mile, "mi", 1609.344))
213
214#define _SDF_ANGULAR_UNITS \
215((Degrees, "deg", 1.0)) \
216((Radians, "rad", 57.2957795130823208768))
217
218#define _SDF_DIMENSIONLESS_UNITS \
219((Percent, "%", 0.01)) \
220((Default, "default", 1.0))
221
222#define _SDF_UNITS \
223((Length, _SDF_LENGTH_UNITS), \
224(Angular, _SDF_ANGULAR_UNITS), \
225(Dimensionless, _SDF_DIMENSIONLESS_UNITS))
226
227#define _SDF_UNIT_TAG(tup) TF_PP_TUPLE_ELEM(0, tup)
228#define _SDF_UNIT_NAME(tup) TF_PP_TUPLE_ELEM(1, tup)
229#define _SDF_UNIT_SCALE(tup) TF_PP_TUPLE_ELEM(2, tup)
230
231#define _SDF_UNITSLIST_CATEGORY(tup) TF_PP_TUPLE_ELEM(0, tup)
232#define _SDF_UNITSLIST_TUPLES(tup) TF_PP_TUPLE_ELEM(1, tup)
233#define _SDF_UNITSLIST_ENUM(elem) TF_PP_CAT(TF_PP_CAT(Sdf, \
234 _SDF_UNITSLIST_CATEGORY(elem)), Unit)
235
236#define _SDF_DECLARE_UNIT_ENUMERANT(tag, elem) \
237 TF_PP_CAT(Sdf ## tag ## Unit, _SDF_UNIT_TAG(elem)),
238
239#define _SDF_DECLARE_UNIT_ENUM(elem) \
240enum _SDF_UNITSLIST_ENUM(elem) { \
241 TF_PP_SEQ_FOR_EACH(_SDF_DECLARE_UNIT_ENUMERANT, \
242 _SDF_UNITSLIST_CATEGORY(elem), \
243 _SDF_UNITSLIST_TUPLES(elem)) \
244};
245
246#define _SDF_FOR_EACH_UNITS_IMPL(macro, ...) \
247 TF_PP_FOR_EACH(macro, __VA_ARGS__)
248#define _SDF_FOR_EACH_UNITS(macro, args) \
249 _SDF_FOR_EACH_UNITS_IMPL(macro, TF_PP_EAT_PARENS(args))
250
251// On Windows this call to _SDF_FOR_EACH_UNITS generates a C4003 warning.
252// This is harmless, but we disable the warning here so that external
253// projects that include this header don't run into it as well.
254ARCH_PRAGMA_PUSH
255ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
256_SDF_FOR_EACH_UNITS(_SDF_DECLARE_UNIT_ENUM, _SDF_UNITS)
257ARCH_PRAGMA_POP
258
260typedef std::map<std::string, VtValue> SdfMapperParametersMap;
261
263typedef std::map<std::string, std::string> SdfVariantSelectionMap;
264
266typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap;
267
269// Note: This map needs to be lexicographically sorted for some downstream
270// clients, so SdfPath::FastLessThan is explicitly omitted as
271// the Compare template parameter.
272typedef std::map<SdfPath, SdfPath> SdfRelocatesMap;
273
276typedef std::pair<SdfPath, SdfPath> SdfRelocate;
277
279typedef std::vector<SdfRelocate> SdfRelocates;
280
282typedef std::map<double, VtValue> SdfTimeSampleMap;
285
290SDF_API
293 SdfTimeSampleMap const &weak);
294
296SDF_API TfEnum SdfDefaultUnit( TfToken const &typeName );
297
299SDF_API const TfEnum &SdfDefaultUnit( const TfEnum &unit );
300
302SDF_API const std::string &SdfUnitCategory( const TfEnum &unit );
303
306SDF_API double SdfConvertUnit( const TfEnum &fromUnit, const TfEnum &toUnit );
307
309SDF_API const std::string &SdfGetNameForUnit( const TfEnum &unit );
310
312SDF_API const TfEnum &SdfGetUnitFromName( const std::string &name );
313
315SDF_API bool SdfValueHasValidType(VtValue const& value);
316
320
325
329
330// Sdf allows a specific set of types for attribute and metadata values.
331// These types and some additional metadata are listed in the preprocessor
332// sequence of tuples below. First element is a tag name that is appended to
333// 'SdfValueType' to produce the C++ traits type for the value type.
334// Second element is the value type name, third element is the corresponding
335// C++ type, and the fourth element is the tuple of tuple dimensions.
336//
337// Libraries may extend this list and define additional value types.
338// When doing so, the type must be declared using the SDF_DECLARE_VALUE_TYPE
339// macro below. The type must also be registered in the associated schema using
340// SdfSchema::_RegisterValueType(s).
341#define _SDF_SCALAR_VALUE_TYPES \
342 ((Bool, bool, bool, () )) \
343 ((UChar, uchar, unsigned char, () )) \
344 ((Int, int, int, () )) \
345 ((UInt, uint, unsigned int, () )) \
346 ((Int64, int64, int64_t, () )) \
347 ((UInt64, uint64, uint64_t, () )) \
348 ((Half, half, GfHalf, () )) \
349 ((Float, float, float, () )) \
350 ((Double, double, double, () )) \
351 ((TimeCode, timecode, GfTimeCode, () )) \
352 ((Duration, duration, GfDuration, () )) \
353 ((String, string, std::string, () )) \
354 ((Token, token, TfToken, () )) \
355 ((Asset, asset, SdfAssetPath, () )) \
356 ((Opaque, opaque, SdfOpaqueValue, () )) \
357 ((PathExpression, pathExpression, SdfPathExpression, () ))
358
359#define _SDF_DIMENSIONED_VALUE_TYPES \
360 ((Matrix2d, matrix2d, GfMatrix2d, (2,2) )) \
361 ((Matrix3d, matrix3d, GfMatrix3d, (3,3) )) \
362 ((Matrix4d, matrix4d, GfMatrix4d, (4,4) )) \
363 ((Quath, quath, GfQuath, (4) )) \
364 ((Quatf, quatf, GfQuatf, (4) )) \
365 ((Quatd, quatd, GfQuatd, (4) )) \
366 ((Int2, int2, GfVec2i, (2) )) \
367 ((Half2, half2, GfVec2h, (2) )) \
368 ((Float2, float2, GfVec2f, (2) )) \
369 ((Double2, double2, GfVec2d, (2) )) \
370 ((Int3, int3, GfVec3i, (3) )) \
371 ((Half3, half3, GfVec3h, (3) )) \
372 ((Float3, float3, GfVec3f, (3) )) \
373 ((Double3, double3, GfVec3d, (3) )) \
374 ((Int4, int4, GfVec4i, (4) )) \
375 ((Half4, half4, GfVec4h, (4) )) \
376 ((Float4, float4, GfVec4f, (4) )) \
377 ((Double4, double4, GfVec4d, (4) ))
378
379#define SDF_VALUE_TYPES _SDF_SCALAR_VALUE_TYPES _SDF_DIMENSIONED_VALUE_TYPES
380
381// Accessors for individual elements in the value types tuples.
382#define SDF_VALUE_CPP_TYPE(tup) TF_PP_TUPLE_ELEM(2, tup)
383#define SDF_VALUE_CPP_ARRAY_TYPE(tup) VtArray<TF_PP_TUPLE_ELEM(2, tup)>
384#define SDF_VALUE_CPP_ARRAY_EDIT_TYPE(tup) VtArrayEdit<TF_PP_TUPLE_ELEM(2, tup)>
385
386template <class T>
387struct SdfValueTypeTraits {
388 static const bool IsValueType = false;
389};
390
391// Allow character arrays to be treated as Sdf value types.
392// Sdf converts character arrays to strings for scene description.
393template <int N>
394struct SdfValueTypeTraits<char[N]> {
395 static const bool IsValueType = true;
396};
397
398#define SDF_DECLARE_VALUE_TYPE_TRAITS(unused, elem) \
399template <> \
400struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
401 static const bool IsValueType = true; \
402}; \
403template <> \
404struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
405 static const bool IsValueType = true; \
406}; \
407template <> \
408struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_EDIT_TYPE(elem)> { \
409 static const bool IsValueType = true; \
410};
411
412TF_PP_SEQ_FOR_EACH(SDF_DECLARE_VALUE_TYPE_TRAITS, ~, SDF_VALUE_TYPES);
413
435SDF_API
436bool
438
439#define SDF_VALUE_ROLE_NAME_TOKENS \
440 (Point) \
441 (Normal) \
442 (Vector) \
443 (Color) \
444 (Frame) \
445 (Transform) \
446 (PointIndex) \
447 (EdgeIndex) \
448 (FaceIndex) \
449 (Group) \
450 (TextureCoordinate)
451
452TF_DECLARE_PUBLIC_TOKENS(SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS);
453
454SDF_DECLARE_HANDLES(SdfLayer);
455
456SDF_DECLARE_HANDLES(SdfAttributeSpec);
457SDF_DECLARE_HANDLES(SdfPrimSpec);
458SDF_DECLARE_HANDLES(SdfPropertySpec);
459SDF_DECLARE_HANDLES(SdfSpec);
460SDF_DECLARE_HANDLES(SdfRelationshipSpec);
461SDF_DECLARE_HANDLES(SdfVariantSetSpec);
462SDF_DECLARE_HANDLES(SdfVariantSpec);
463
464typedef std::map<std::string, SdfVariantSetSpecHandle>
465 SdfVariantSetSpecHandleMap;
466
468SDF_API
469std::ostream & operator<<( std::ostream &out, const SdfSpecifier &spec );
470
472SDF_API
473std::ostream & operator<<( std::ostream &out,
474 const SdfRelocatesMap &reloMap );
475
477SDF_API
478std::ostream & operator<<( std::ostream &out,
479 const SdfRelocates &relocates );
480
482SDF_API
483std::ostream & operator<<( std::ostream &out,
484 const SdfTimeSampleMap &sampleMap );
485
486SDF_API
487std::ostream &VtStreamOut(const SdfVariantSelectionMap &, std::ostream &);
488
498{
499public:
502
504 SDF_API explicit SdfUnregisteredValue(const std::string &value);
505
507 SDF_API explicit SdfUnregisteredValue(const VtDictionary &value);
508
510 SDF_API explicit SdfUnregisteredValue(const SdfUnregisteredValueListOp &value);
511
513 const VtValue& GetValue() const {
514 return _value;
515 }
516
518 friend size_t hash_value(const SdfUnregisteredValue &uv) {
519 return uv._value.GetHash();
520 }
521
523 SDF_API bool operator==(const SdfUnregisteredValue &other) const;
524
526 SDF_API bool operator!=(const SdfUnregisteredValue &other) const;
527
528private:
529 VtValue _value;
530};
531
533SDF_API std::ostream &operator << (std::ostream &out, const SdfUnregisteredValue &value);
534
535class Sdf_ValueTypeNamesType {
536 Sdf_ValueTypeNamesType(const Sdf_ValueTypeNamesType&) = delete;
537 Sdf_ValueTypeNamesType& operator=(const Sdf_ValueTypeNamesType&) = delete;
538public:
539 SdfValueTypeName Bool;
540 SdfValueTypeName UChar, Int, UInt, Int64, UInt64;
541 SdfValueTypeName Half, Float, Double;
542 SdfValueTypeName TimeCode, Duration;
543 SdfValueTypeName String, Token, Asset;
544 SdfValueTypeName Int2, Int3, Int4;
545 SdfValueTypeName Half2, Half3, Half4;
546 SdfValueTypeName Float2, Float3, Float4;
547 SdfValueTypeName Double2, Double3, Double4;
548 SdfValueTypeName Point3h, Point3f, Point3d;
549 SdfValueTypeName Vector3h, Vector3f, Vector3d;
550 SdfValueTypeName Normal3h, Normal3f, Normal3d;
551 SdfValueTypeName Color3h, Color3f, Color3d;
552 SdfValueTypeName Color4h, Color4f, Color4d;
553 SdfValueTypeName Quath, Quatf, Quatd;
554 SdfValueTypeName Matrix2d, Matrix3d, Matrix4d;
555 SdfValueTypeName Frame4d;
556 SdfValueTypeName TexCoord2h, TexCoord2f, TexCoord2d;
557 SdfValueTypeName TexCoord3h, TexCoord3f, TexCoord3d;
558 SdfValueTypeName Opaque;
559 SdfValueTypeName Group;
560 SdfValueTypeName PathExpression;
561
562 SdfValueTypeName BoolArray;
563 SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
564 SdfValueTypeName HalfArray, FloatArray, DoubleArray;
565 SdfValueTypeName TimeCodeArray, DurationArray;
566 SdfValueTypeName StringArray, TokenArray, AssetArray;
567 SdfValueTypeName Int2Array, Int3Array, Int4Array;
568 SdfValueTypeName Half2Array, Half3Array, Half4Array;
569 SdfValueTypeName Float2Array, Float3Array, Float4Array;
570 SdfValueTypeName Double2Array, Double3Array, Double4Array;
571 SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
572 SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
573 SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
574 SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
575 SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
576 SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
577 SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
578 SdfValueTypeName Frame4dArray;
579 SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
580 SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
581 SdfValueTypeName PathExpressionArray;
582
583 SDF_API ~Sdf_ValueTypeNamesType();
584 struct _Init {
585 SDF_API static const Sdf_ValueTypeNamesType* New();
586 };
587
588 // For Pixar internal backwards compatibility.
589 TfToken GetSerializationName(const SdfValueTypeName&) const;
590 TfToken GetSerializationName(const VtValue&) const;
591 TfToken GetSerializationName(const TfToken&) const;
592
593private:
594 friend const Sdf_ValueTypeNamesType* Sdf_InitializeValueTypeNames();
595 Sdf_ValueTypeNamesType();
596};
597
598extern SDF_API TfStaticData<const Sdf_ValueTypeNamesType,
599 Sdf_ValueTypeNamesType::_Init> SdfValueTypeNames;
600
616 bool operator==(const SdfValueBlock& block) const { return true; }
617 bool operator!=(const SdfValueBlock& block) const { return false; }
618
619private:
620 friend inline size_t hash_value(const SdfValueBlock &block) { return 0; }
621};
622
623// Write out the string representation of a block.
624SDF_API std::ostream& operator<<(std::ostream&, SdfValueBlock const&);
625
631 bool operator==(const SdfAnimationBlock& block) const { return true; }
632 bool operator!=(const SdfAnimationBlock& block) const { return false; }
633
634private:
635 friend inline size_t hash_value(const SdfAnimationBlock &block) { return 0; }
636};
637
638// Write out the string representation of an animation block.
639SDF_API std::ostream& operator<<(std::ostream&, SdfAnimationBlock const&);
640
641// A class that represents a human-readable value. This is used for the special
642// purpose of producing layers that serialize field values in alternate ways; to
643// produce more human-readable output, for example.
644struct SdfHumanReadableValue {
645 SdfHumanReadableValue() = default;
646 explicit SdfHumanReadableValue(std::string const &text) : _text(text) {}
647
648 bool operator==(SdfHumanReadableValue const &other) const {
649 return GetText() == other.GetText();
650 }
651 bool operator!=(SdfHumanReadableValue const &other) const {
652 return !(*this == other);
653 }
654
655 std::string const &GetText() const { return _text; }
656private:
657 std::string _text;
658};
659
660SDF_API
661std::ostream &operator<<(std::ostream &out, const SdfHumanReadableValue &hrval);
662
663SDF_API
664size_t hash_value(const SdfHumanReadableValue &hrval);
665
666PXR_NAMESPACE_CLOSE_SCOPE
667
668#endif // PXR_USD_SDF_TYPES_H
#define VT_VALUE_TYPE_CAN_TRANSFORM(T)
A helper for specializing the above trait.
Definition traits.h:150
#define VT_VALUE_TYPE_CAN_COMPOSE(T)
A helper for specializing the above trait.
Definition traits.h:140
A subclass of SdfPropertySpec that holds typed data.
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:281
Represents a prim description in an SdfLayer object.
Definition primSpec.h:58
Base class for SdfAttributeSpec and SdfRelationshipSpec.
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:498
const VtValue & GetValue() const
Returns the wrapped VtValue specified in the constructor.
Definition types.h:513
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:518
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.
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:81
TfType represents a dynamic runtime type.
Definition type.h:48
A map with string keys and VtValue values.
Definition dictionary.h:52
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition value.h:90
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.
This header serves to simply bring in the half float datatype and provide a hash_value function.
std::size_t hash_value(const half h)
Overload hash_value for half.
Definition half.h:30
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.
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition types.h:630
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition types.h:615
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:183
SdfSpecType
An enum that specifies the type of an object.
Definition types.h:73
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:105
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:276
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:266
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:260
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:161
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:263
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:279
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:137
bool SdfIsDefiningSpecifier(SdfSpecifier spec)
Returns true if the specifier defines a prim.
Definition types.h:115
SDF_API bool SdfConvertToValidMetadataDictionary(VtDictionary *dict, std::string *errMsg)
Convert dict to a valid metadata dictionary for scene description.
SDF_API SdfTimeSampleMap SdfComposeTimeSampleMaps(SdfTimeSampleMap const &strong, SdfTimeSampleMap const &weak)
Compose a stronger SdfTimeSampleMap over a weaker one.
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:272
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition types.h:282