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
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"
53#include "pxr/base/vt/traits.h"
54#include "pxr/base/vt/value.h"
55#include "pxr/base/vt/valueTransform.h"
56
57#include <iosfwd>
58#include <list>
59#include <map>
60#include <stdint.h>
61#include <string>
62#include <typeinfo>
63#include <vector>
64
65PXR_NAMESPACE_OPEN_SCOPE
66
67class SdfPath;
68
72 // The unknown type has a value of 0 so that SdfSpecType() is unknown.
73 SdfSpecTypeUnknown = 0,
74
75 // Real concrete types
76 SdfSpecTypeAttribute,
77 SdfSpecTypeConnection,
78 SdfSpecTypeExpression,
79 SdfSpecTypeMapper,
80 SdfSpecTypeMapperArg,
81 SdfSpecTypePrim,
82 SdfSpecTypePseudoRoot,
83 SdfSpecTypeRelationship,
84 SdfSpecTypeRelationshipTarget,
85 SdfSpecTypeVariant,
86 SdfSpecTypeVariantSet,
87
88 SdfNumSpecTypes
89};
90
104 SdfSpecifierDef,
105 SdfSpecifierOver,
106 SdfSpecifierClass,
107 SdfNumSpecifiers
108};
109
111inline
112bool
114{
115 return (spec != SdfSpecifierOver);
116}
117
136 SdfPermissionPublic,
137 SdfPermissionPrivate,
138
139 SdfNumPermissions
140};
141
160 SdfVariabilityVarying,
161 SdfVariabilityUniform,
162
163 SdfNumVariabilities
164};
165
166
181{
182 SdfAuthoringErrorUnrecognizedFields,
183 SdfAuthoringErrorUnrecognizedSpecType
184};
185
186// Each category of compatible units of measurement is defined by a
187// preprocessor sequence of tuples. Each such sequence gives rise to an enum
188// representing the corresponding unit category. All the unit categories are
189// listed in _SDF_UNITS where each entry is a two-tuple with the unit category
190// name as the first element, and the second element is the units in that
191// category. Each tuple in a unit category sequence corresponds to a unit of
192// measurement represented by an enumerant whose name is given by concatenating
193// 'Sdf', the unit category name, the word 'Unit' and the first entry in the
194// tuple. (E.g. units of category 'Length' are represented by an enum named
195// SdfLengthUnit with enumerants SdfLengthUnitInch, SdfLengthUnitMeter and so
196// forth.) The second element in the tuple is the display name for the unit,
197// and the third element is the relative size of the unit compared to the menv
198// default unit for the unit category (which has a relative size of 1.0).
199// Dimensionless quantities use a special 'Dimensionless' unit category
200// represented by the enum SdfDimensionlessUnit.
201#define _SDF_LENGTH_UNITS \
202((Millimeter, "mm", 0.001)) \
203((Centimeter, "cm", 0.01)) \
204((Decimeter, "dm", 0.1)) \
205((Meter, "m", 1.0)) \
206((Kilometer, "km", 1000.0)) \
207((Inch, "in", 0.0254)) \
208((Foot, "ft", 0.3048)) \
209((Yard, "yd", 0.9144)) \
210((Mile, "mi", 1609.344))
211
212#define _SDF_ANGULAR_UNITS \
213((Degrees, "deg", 1.0)) \
214((Radians, "rad", 57.2957795130823208768))
215
216#define _SDF_DIMENSIONLESS_UNITS \
217((Percent, "%", 0.01)) \
218((Default, "default", 1.0))
219
220#define _SDF_UNITS \
221((Length, _SDF_LENGTH_UNITS), \
222(Angular, _SDF_ANGULAR_UNITS), \
223(Dimensionless, _SDF_DIMENSIONLESS_UNITS))
224
225#define _SDF_UNIT_TAG(tup) TF_PP_TUPLE_ELEM(0, tup)
226#define _SDF_UNIT_NAME(tup) TF_PP_TUPLE_ELEM(1, tup)
227#define _SDF_UNIT_SCALE(tup) TF_PP_TUPLE_ELEM(2, tup)
228
229#define _SDF_UNITSLIST_CATEGORY(tup) TF_PP_TUPLE_ELEM(0, tup)
230#define _SDF_UNITSLIST_TUPLES(tup) TF_PP_TUPLE_ELEM(1, tup)
231#define _SDF_UNITSLIST_ENUM(elem) TF_PP_CAT(TF_PP_CAT(Sdf, \
232 _SDF_UNITSLIST_CATEGORY(elem)), Unit)
233
234#define _SDF_DECLARE_UNIT_ENUMERANT(tag, elem) \
235 TF_PP_CAT(Sdf ## tag ## Unit, _SDF_UNIT_TAG(elem)),
236
237#define _SDF_DECLARE_UNIT_ENUM(elem) \
238enum _SDF_UNITSLIST_ENUM(elem) { \
239 TF_PP_SEQ_FOR_EACH(_SDF_DECLARE_UNIT_ENUMERANT, \
240 _SDF_UNITSLIST_CATEGORY(elem), \
241 _SDF_UNITSLIST_TUPLES(elem)) \
242};
243
244#define _SDF_FOR_EACH_UNITS_IMPL(macro, ...) \
245 TF_PP_FOR_EACH(macro, __VA_ARGS__)
246#define _SDF_FOR_EACH_UNITS(macro, args) \
247 _SDF_FOR_EACH_UNITS_IMPL(macro, TF_PP_EAT_PARENS(args))
248
249// On Windows this call to _SDF_FOR_EACH_UNITS generates a C4003 warning.
250// This is harmless, but we disable the warning here so that external
251// projects that include this header don't run into it as well.
252ARCH_PRAGMA_PUSH
253ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
254_SDF_FOR_EACH_UNITS(_SDF_DECLARE_UNIT_ENUM, _SDF_UNITS)
255ARCH_PRAGMA_POP
256
258typedef std::map<std::string, VtValue> SdfMapperParametersMap;
259
261typedef std::map<std::string, std::string> SdfVariantSelectionMap;
262
264typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap;
265
267// Note: This map needs to be lexicographically sorted for some downstream
268// clients, so SdfPath::FastLessThan is explicitly omitted as
269// the Compare template parameter.
270typedef std::map<SdfPath, SdfPath> SdfRelocatesMap;
271
274typedef std::pair<SdfPath, SdfPath> SdfRelocate;
275
277typedef std::vector<SdfRelocate> SdfRelocates;
278
280typedef std::map<double, VtValue> SdfTimeSampleMap;
282
284SDF_API TfEnum SdfDefaultUnit( TfToken const &typeName );
285
287SDF_API const TfEnum &SdfDefaultUnit( const TfEnum &unit );
288
290SDF_API const std::string &SdfUnitCategory( const TfEnum &unit );
291
294SDF_API double SdfConvertUnit( const TfEnum &fromUnit, const TfEnum &toUnit );
295
297SDF_API const std::string &SdfGetNameForUnit( const TfEnum &unit );
298
300SDF_API const TfEnum &SdfGetUnitFromName( const std::string &name );
301
303SDF_API bool SdfValueHasValidType(VtValue const& value);
304
308
313
317
318// Sdf allows a specific set of types for attribute and metadata values.
319// These types and some additional metadata are listed in the preprocessor
320// sequence of tuples below. First element is a tag name that is appended to
321// 'SdfValueType' to produce the C++ traits type for the value type.
322// Second element is the value type name, third element is the corresponding
323// C++ type, and the fourth element is the tuple of tuple dimensions.
324//
325// Libraries may extend this list and define additional value types.
326// When doing so, the type must be declared using the SDF_DECLARE_VALUE_TYPE
327// macro below. The type must also be registered in the associated schema using
328// SdfSchema::_RegisterValueType(s).
329#define _SDF_SCALAR_VALUE_TYPES \
330 ((Bool, bool, bool, () )) \
331 ((UChar, uchar, unsigned char, () )) \
332 ((Int, int, int, () )) \
333 ((UInt, uint, unsigned int, () )) \
334 ((Int64, int64, int64_t, () )) \
335 ((UInt64, uint64, uint64_t, () )) \
336 ((Half, half, GfHalf, () )) \
337 ((Float, float, float, () )) \
338 ((Double, double, double, () )) \
339 ((TimeCode, timecode, SdfTimeCode, () )) \
340 ((String, string, std::string, () )) \
341 ((Token, token, TfToken, () )) \
342 ((Asset, asset, SdfAssetPath, () )) \
343 ((Opaque, opaque, SdfOpaqueValue, () )) \
344 ((PathExpression, pathExpression, SdfPathExpression, () ))
345
346#define _SDF_DIMENSIONED_VALUE_TYPES \
347 ((Matrix2d, matrix2d, GfMatrix2d, (2,2) )) \
348 ((Matrix3d, matrix3d, GfMatrix3d, (3,3) )) \
349 ((Matrix4d, matrix4d, GfMatrix4d, (4,4) )) \
350 ((Quath, quath, GfQuath, (4) )) \
351 ((Quatf, quatf, GfQuatf, (4) )) \
352 ((Quatd, quatd, GfQuatd, (4) )) \
353 ((Int2, int2, GfVec2i, (2) )) \
354 ((Half2, half2, GfVec2h, (2) )) \
355 ((Float2, float2, GfVec2f, (2) )) \
356 ((Double2, double2, GfVec2d, (2) )) \
357 ((Int3, int3, GfVec3i, (3) )) \
358 ((Half3, half3, GfVec3h, (3) )) \
359 ((Float3, float3, GfVec3f, (3) )) \
360 ((Double3, double3, GfVec3d, (3) )) \
361 ((Int4, int4, GfVec4i, (4) )) \
362 ((Half4, half4, GfVec4h, (4) )) \
363 ((Float4, float4, GfVec4f, (4) )) \
364 ((Double4, double4, GfVec4d, (4) ))
365
366#define SDF_VALUE_TYPES _SDF_SCALAR_VALUE_TYPES _SDF_DIMENSIONED_VALUE_TYPES
367
368// Accessors for individual elements in the value types tuples.
369#define SDF_VALUE_CPP_TYPE(tup) TF_PP_TUPLE_ELEM(2, tup)
370#define SDF_VALUE_CPP_ARRAY_TYPE(tup) VtArray<TF_PP_TUPLE_ELEM(2, tup)>
371#define SDF_VALUE_CPP_ARRAY_EDIT_TYPE(tup) VtArrayEdit<TF_PP_TUPLE_ELEM(2, tup)>
372
373template <class T>
374struct SdfValueTypeTraits {
375 static const bool IsValueType = false;
376};
377
378// Allow character arrays to be treated as Sdf value types.
379// Sdf converts character arrays to strings for scene description.
380template <int N>
381struct SdfValueTypeTraits<char[N]> {
382 static const bool IsValueType = true;
383};
384
385#define SDF_DECLARE_VALUE_TYPE_TRAITS(unused, elem) \
386template <> \
387struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
388 static const bool IsValueType = true; \
389}; \
390template <> \
391struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
392 static const bool IsValueType = true; \
393}; \
394template <> \
395struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_EDIT_TYPE(elem)> { \
396 static const bool IsValueType = true; \
397};
398
399TF_PP_SEQ_FOR_EACH(SDF_DECLARE_VALUE_TYPE_TRAITS, ~, SDF_VALUE_TYPES);
400
422SDF_API
423bool
425
426#define SDF_VALUE_ROLE_NAME_TOKENS \
427 (Point) \
428 (Normal) \
429 (Vector) \
430 (Color) \
431 (Frame) \
432 (Transform) \
433 (PointIndex) \
434 (EdgeIndex) \
435 (FaceIndex) \
436 (Group) \
437 (TextureCoordinate)
438
439TF_DECLARE_PUBLIC_TOKENS(SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS);
440
441SDF_DECLARE_HANDLES(SdfLayer);
442
443SDF_DECLARE_HANDLES(SdfAttributeSpec);
444SDF_DECLARE_HANDLES(SdfPrimSpec);
445SDF_DECLARE_HANDLES(SdfPropertySpec);
446SDF_DECLARE_HANDLES(SdfSpec);
447SDF_DECLARE_HANDLES(SdfRelationshipSpec);
448SDF_DECLARE_HANDLES(SdfVariantSetSpec);
449SDF_DECLARE_HANDLES(SdfVariantSpec);
450
451typedef std::map<std::string, SdfVariantSetSpecHandle>
452 SdfVariantSetSpecHandleMap;
453
455SDF_API
456std::ostream & operator<<( std::ostream &out, const SdfSpecifier &spec );
457
459SDF_API
460std::ostream & operator<<( std::ostream &out,
461 const SdfRelocatesMap &reloMap );
462
464SDF_API
465std::ostream & operator<<( std::ostream &out,
466 const SdfRelocates &relocates );
467
469SDF_API
470std::ostream & operator<<( std::ostream &out,
471 const SdfTimeSampleMap &sampleMap );
472
473SDF_API
474std::ostream &VtStreamOut(const SdfVariantSelectionMap &, std::ostream &);
475
485{
486public:
489
491 SDF_API explicit SdfUnregisteredValue(const std::string &value);
492
494 SDF_API explicit SdfUnregisteredValue(const VtDictionary &value);
495
497 SDF_API explicit SdfUnregisteredValue(const SdfUnregisteredValueListOp &value);
498
500 const VtValue& GetValue() const {
501 return _value;
502 }
503
505 friend size_t hash_value(const SdfUnregisteredValue &uv) {
506 return uv._value.GetHash();
507 }
508
510 SDF_API bool operator==(const SdfUnregisteredValue &other) const;
511
513 SDF_API bool operator!=(const SdfUnregisteredValue &other) const;
514
515private:
516 VtValue _value;
517};
518
520SDF_API std::ostream &operator << (std::ostream &out, const SdfUnregisteredValue &value);
521
522class Sdf_ValueTypeNamesType {
523 Sdf_ValueTypeNamesType(const Sdf_ValueTypeNamesType&) = delete;
524 Sdf_ValueTypeNamesType& operator=(const Sdf_ValueTypeNamesType&) = delete;
525public:
526 SdfValueTypeName Bool;
527 SdfValueTypeName UChar, Int, UInt, Int64, UInt64;
528 SdfValueTypeName Half, Float, Double, TimeCode;
529 SdfValueTypeName String, Token, Asset;
530 SdfValueTypeName Int2, Int3, Int4;
531 SdfValueTypeName Half2, Half3, Half4;
532 SdfValueTypeName Float2, Float3, Float4;
533 SdfValueTypeName Double2, Double3, Double4;
534 SdfValueTypeName Point3h, Point3f, Point3d;
535 SdfValueTypeName Vector3h, Vector3f, Vector3d;
536 SdfValueTypeName Normal3h, Normal3f, Normal3d;
537 SdfValueTypeName Color3h, Color3f, Color3d;
538 SdfValueTypeName Color4h, Color4f, Color4d;
539 SdfValueTypeName Quath, Quatf, Quatd;
540 SdfValueTypeName Matrix2d, Matrix3d, Matrix4d;
541 SdfValueTypeName Frame4d;
542 SdfValueTypeName TexCoord2h, TexCoord2f, TexCoord2d;
543 SdfValueTypeName TexCoord3h, TexCoord3f, TexCoord3d;
544 SdfValueTypeName Opaque;
545 SdfValueTypeName Group;
546 SdfValueTypeName PathExpression;
547
548 SdfValueTypeName BoolArray;
549 SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
550 SdfValueTypeName HalfArray, FloatArray, DoubleArray, TimeCodeArray;
551 SdfValueTypeName StringArray, TokenArray, AssetArray;
552 SdfValueTypeName Int2Array, Int3Array, Int4Array;
553 SdfValueTypeName Half2Array, Half3Array, Half4Array;
554 SdfValueTypeName Float2Array, Float3Array, Float4Array;
555 SdfValueTypeName Double2Array, Double3Array, Double4Array;
556 SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
557 SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
558 SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
559 SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
560 SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
561 SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
562 SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
563 SdfValueTypeName Frame4dArray;
564 SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
565 SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
566 SdfValueTypeName PathExpressionArray;
567
568 SDF_API ~Sdf_ValueTypeNamesType();
569 struct _Init {
570 SDF_API static const Sdf_ValueTypeNamesType* New();
571 };
572
573 // For Pixar internal backwards compatibility.
574 TfToken GetSerializationName(const SdfValueTypeName&) const;
575 TfToken GetSerializationName(const VtValue&) const;
576 TfToken GetSerializationName(const TfToken&) const;
577
578private:
579 friend const Sdf_ValueTypeNamesType* Sdf_InitializeValueTypeNames();
580 Sdf_ValueTypeNamesType();
581};
582
583extern SDF_API TfStaticData<const Sdf_ValueTypeNamesType,
584 Sdf_ValueTypeNamesType::_Init> SdfValueTypeNames;
585
601 bool operator==(const SdfValueBlock& block) const { return true; }
602 bool operator!=(const SdfValueBlock& block) const { return false; }
603
604private:
605 friend inline size_t hash_value(const SdfValueBlock &block) { return 0; }
606};
607
608// Write out the string representation of a block.
609SDF_API std::ostream& operator<<(std::ostream&, SdfValueBlock const&);
610
616 bool operator==(const SdfAnimationBlock& block) const { return true; }
617 bool operator!=(const SdfAnimationBlock& block) const { return false; }
618
619private:
620 friend inline size_t hash_value(const SdfAnimationBlock &block) { return 0; }
621};
622
623// Write out the string representation of an animation block.
624SDF_API std::ostream& operator<<(std::ostream&, SdfAnimationBlock const&);
625
626// A class that represents a human-readable value. This is used for the special
627// purpose of producing layers that serialize field values in alternate ways; to
628// produce more human-readable output, for example.
629struct SdfHumanReadableValue {
630 SdfHumanReadableValue() = default;
631 explicit SdfHumanReadableValue(std::string const &text) : _text(text) {}
632
633 bool operator==(SdfHumanReadableValue const &other) const {
634 return GetText() == other.GetText();
635 }
636 bool operator!=(SdfHumanReadableValue const &other) const {
637 return !(*this == other);
638 }
639
640 std::string const &GetText() const { return _text; }
641private:
642 std::string _text;
643};
644
645SDF_API
646std::ostream &operator<<(std::ostream &out, const SdfHumanReadableValue &hrval);
647
648SDF_API
649size_t hash_value(const SdfHumanReadableValue &hrval);
650
651PXR_NAMESPACE_CLOSE_SCOPE
652
653#endif // PXR_USD_SDF_TYPES_H
#define VT_VALUE_TYPE_CAN_TRANSFORM(T)
A helper for specializing the above trait.
Definition: traits.h:150
A subclass of SdfPropertySpec that holds typed data.
Definition: attributeSpec.h:42
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:280
Represents a prim description in an SdfLayer object.
Definition: primSpec.h:58
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:47
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:485
const VtValue & GetValue() const
Returns the wrapped VtValue specified in the constructor.
Definition: types.h:500
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:505
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:72
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: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.
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.
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.
Definition: staticTokens.h:92
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition: types.h:615
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition: types.h:600
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:181
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:71
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:103
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:274
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:264
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:258
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:159
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:261
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:277
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:135
bool SdfIsDefiningSpecifier(SdfSpecifier spec)
Returns true if the specifier defines a prim.
Definition: types.h:113
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:270
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:280