Loading...
Searching...
No Matches
stage.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_USD_STAGE_H
8#define PXR_USD_USD_STAGE_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usd/api.h"
14#include "pxr/usd/usd/common.h"
15#include "pxr/usd/usd/editTarget.h"
17#include "pxr/usd/usd/schemaRegistry.h"
19#include "pxr/usd/usd/stagePopulationMask.h"
20#include "pxr/usd/usd/primDefinition.h"
22
24#include "pxr/base/tf/hashmap.h"
26
27#include "pxr/usd/ar/ar.h"
28#include "pxr/usd/ar/notice.h"
30#include "pxr/usd/sdf/notice.h"
31#include "pxr/usd/sdf/path.h"
32#include "pxr/usd/sdf/types.h"
33#include "pxr/usd/pcp/cache.h"
34#include "pxr/base/vt/value.h"
36
37#include <tbb/concurrent_vector.h>
38#include <tbb/concurrent_unordered_set.h>
39#include <tbb/concurrent_hash_map.h>
40#include <tbb/spin_rw_mutex.h>
41
42#include <functional>
43#include <string>
44#include <memory>
45#include <optional>
46#include <unordered_map>
47#include <utility>
48
49PXR_NAMESPACE_OPEN_SCOPE
50
52class GfInterval;
54class Usd_AssetPathContext;
55class Usd_ClipCache;
56class Usd_InstanceCache;
57class Usd_InstanceChanges;
58class Usd_InterpolatorBase;
59class Usd_Resolver;
60class UsdResolveInfo;
62class UsdPrim;
63class UsdPrimRange;
64
65SDF_DECLARE_HANDLES(SdfLayer);
66
134class UsdStage : public TfRefBase, public TfWeakBase {
135public:
136
137 // --------------------------------------------------------------------- //
141 // --------------------------------------------------------------------- //
142
148 {
150 LoadNone
151 };
152
163 //
175 USD_API
176 static UsdStageRefPtr
177 CreateNew(const std::string& identifier,
178 InitialLoadSet load = LoadAll);
180 USD_API
181 static UsdStageRefPtr
182 CreateNew(const std::string& identifier,
183 const SdfLayerHandle& sessionLayer,
184 InitialLoadSet load = LoadAll);
186 USD_API
187 static UsdStageRefPtr
188 CreateNew(const std::string& identifier,
189 const SdfLayerHandle& sessionLayer,
190 const ArResolverContext& pathResolverContext,
191 InitialLoadSet load = LoadAll);
193 USD_API
194 static UsdStageRefPtr
195 CreateNew(const std::string& identifier,
196 const ArResolverContext& pathResolverContext,
197 InitialLoadSet load = LoadAll);
198
216 USD_API
217 static UsdStageRefPtr
220 USD_API
221 static UsdStageRefPtr
222 CreateInMemory(const std::string& identifier,
223 InitialLoadSet load = LoadAll);
225 USD_API
226 static UsdStageRefPtr
227 CreateInMemory(const std::string& identifier,
228 const ArResolverContext& pathResolverContext,
229 InitialLoadSet load = LoadAll);
231 USD_API
232 static UsdStageRefPtr
233 CreateInMemory(const std::string& identifier,
234 const SdfLayerHandle &sessionLayer,
235 InitialLoadSet load = LoadAll);
237 USD_API
238 static UsdStageRefPtr
239 CreateInMemory(const std::string& identifier,
240 const SdfLayerHandle &sessionLayer,
241 const ArResolverContext& pathResolverContext,
242 InitialLoadSet load = LoadAll);
243
259 USD_API
260 static UsdStageRefPtr
261 Open(const std::string& filePath, InitialLoadSet load = LoadAll);
263 USD_API
264 static UsdStageRefPtr
265 Open(const std::string& filePath,
266 const ArResolverContext& pathResolverContext,
267 InitialLoadSet load = LoadAll);
268
286 USD_API
287 static UsdStageRefPtr
288 OpenMasked(const std::string &filePath,
289 UsdStagePopulationMask const &mask,
290 InitialLoadSet load = LoadAll);
292 USD_API
293 static UsdStageRefPtr
294 OpenMasked(const std::string &filePath,
295 const ArResolverContext &pathResolverContext,
296 UsdStagePopulationMask const &mask,
297 InitialLoadSet load = LoadAll);
298
327 USD_API
328 static UsdStageRefPtr
329 Open(const SdfLayerHandle& rootLayer,
332 USD_API
333 static UsdStageRefPtr
334 Open(const SdfLayerHandle& rootLayer,
335 const SdfLayerHandle& sessionLayer,
338 USD_API
339 static UsdStageRefPtr
340 Open(const SdfLayerHandle& rootLayer,
341 const ArResolverContext& pathResolverContext,
344 USD_API
345 static UsdStageRefPtr
346 Open(const SdfLayerHandle& rootLayer,
347 const SdfLayerHandle& sessionLayer,
348 const ArResolverContext& pathResolverContext,
350
371 USD_API
372 static UsdStageRefPtr
373 OpenMasked(const SdfLayerHandle& rootLayer,
374 const UsdStagePopulationMask &mask,
377 USD_API
378 static UsdStageRefPtr
379 OpenMasked(const SdfLayerHandle& rootLayer,
380 const SdfLayerHandle& sessionLayer,
381 const UsdStagePopulationMask &mask,
384 USD_API
385 static UsdStageRefPtr
386 OpenMasked(const SdfLayerHandle& rootLayer,
387 const ArResolverContext& pathResolverContext,
388 const UsdStagePopulationMask &mask,
391 USD_API
392 static UsdStageRefPtr
393 OpenMasked(const SdfLayerHandle& rootLayer,
394 const SdfLayerHandle& sessionLayer,
395 const ArResolverContext& pathResolverContext,
396 const UsdStagePopulationMask &mask,
398
399 USD_API
400 virtual ~UsdStage();
401
419 USD_API
420 void Reload();
421
430 USD_API
431 static bool
432 IsSupportedFile(const std::string& filePath);
433
435
436 // --------------------------------------------------------------------- //
445
453 USD_API
454 void Save();
455
463 USD_API
465
467
468 // --------------------------------------------------------------------- //
514
516 USD_API
518
524 USD_API
525 static void
527
529
530 // --------------------------------------------------------------------- //
559 // --------------------------------------------------------------------- //
560
568 USD_API
571
577 USD_API
579
591 USD_API
592 void LoadAndUnload(const SdfPathSet &loadSet, const SdfPathSet &unloadSet,
594
605 USD_API
606 SdfPathSet GetLoadSet();
607
627 USD_API
628 SdfPathSet FindLoadable(
629 const SdfPath& rootPath = SdfPath::AbsoluteRootPath());
630
637 return _loadRules;
638 }
639
649 USD_API
650 void SetLoadRules(UsdStageLoadRules const &rules);
651
654 return _populationMask;
655 }
656
658 USD_API
660
674 USD_API
676 Usd_PrimFlagsPredicate const &traversalPredicate,
677 std::function<bool (UsdRelationship const &)> const &relPred = nullptr,
678 std::function<bool (UsdAttribute const &)> const &attrPred = nullptr);
679
683 USD_API
685 std::function<bool (UsdRelationship const &)> const &relPred = nullptr,
686 std::function<bool (UsdAttribute const &)> const &attrPred = nullptr);
687
689
690 // --------------------------------------------------------------------- //
699 // --------------------------------------------------------------------- //
700
710 USD_API
712
720 USD_API
722
734 USD_API
735 void SetDefaultPrim(const UsdPrim &prim);
736
744 USD_API
746
754 USD_API
755 bool HasDefaultPrim() const;
756
766 USD_API
767 UsdPrim GetPrimAtPath(const SdfPath &path) const;
768
793 USD_API
795
804 USD_API
806
815 USD_API
817
826 USD_API
828private:
829 // Return the primData object at \p path.
830 Usd_PrimDataConstPtr _GetPrimDataAtPath(const SdfPath &path) const;
831 Usd_PrimDataPtr _GetPrimDataAtPath(const SdfPath &path);
832
833 // Return the primData object at \p path. If \p path indicates a prim
834 // beneath an instance, return the primData object for the corresponding
835 // prim in the instance's prototype.
836 Usd_PrimDataConstPtr
837 _GetPrimDataAtPathOrInPrototype(const SdfPath &path) const;
838
840 std::vector<UsdPrim>
841 _GetInstancesForPrototype(const UsdPrim& prototype) const;
842
843public:
844
865 USD_API
867
872 USD_API
873 UsdPrimRange Traverse(const Usd_PrimFlagsPredicate &predicate);
874
879 USD_API
881
900 USD_API
902
926 USD_API
928 const TfToken &typeName=TfToken());
929
942 USD_API
943 UsdPrim CreateClassPrim(const SdfPath &rootPrimPath);
944
966 USD_API
967 bool RemovePrim(const SdfPath& path);
968
970
971 // --------------------------------------------------------------------- //
975 // --------------------------------------------------------------------- //
976
978 USD_API
979 SdfLayerHandle GetSessionLayer() const;
980
982 USD_API
983 SdfLayerHandle GetRootLayer() const;
984
989 USD_API
991
1001 USD_API
1002 std::string
1003 ResolveIdentifierToEditTarget(std::string const &identifier) const;
1004
1007 USD_API
1008 PcpErrorVector GetCompositionErrors() const;
1009
1015 USD_API
1016 SdfLayerHandleVector GetLayerStack(bool includeSessionLayers=true) const;
1017
1029 USD_API
1030 SdfLayerHandleVector GetUsedLayers(bool includeClipLayers=true) const;
1031
1034 USD_API
1035 bool HasLocalLayer(const SdfLayerHandle &layer) const;
1036
1038 USD_API
1040
1044 USD_API
1046
1050 USD_API
1051 UsdEditTarget GetEditTargetForLocalLayer(const SdfLayerHandle &layer);
1052
1059 USD_API
1060 void SetEditTarget(const UsdEditTarget &editTarget);
1061
1088 USD_API
1089 void MuteLayer(const std::string &layerIdentifier);
1090
1093 USD_API
1094 void UnmuteLayer(const std::string &layerIdentifier);
1095
1103 USD_API
1104 void MuteAndUnmuteLayers(const std::vector<std::string> &muteLayers,
1105 const std::vector<std::string> &unmuteLayers);
1106
1108 USD_API
1109 const std::vector<std::string>& GetMutedLayers() const;
1110
1115 USD_API
1116 bool IsLayerMuted(const std::string& layerIdentifier) const;
1117
1119
1120 // --------------------------------------------------------------------- //
1124 // --------------------------------------------------------------------- //
1125 // Future Work:
1126 // * Flatten sub-trees or individual prims
1127 // * Allow flattening of local LayerStack
1128 // * Move Flatten into a free-function to ensure it doesn't rely on
1129 // Stage internals.
1130
1138 USD_API
1139 bool Export(const std::string &filename,
1140 bool addSourceFileComment=true,
1141 const SdfLayer::FileFormatArguments &args =
1143
1151 USD_API
1152 bool ExportToString(std::string *result,
1153 bool addSourceFileComment=true) const;
1154
1181 USD_API
1182 SdfLayerRefPtr Flatten(bool addSourceFileComment=true) const;
1184
1185public:
1186 // --------------------------------------------------------------------- //
1194 // --------------------------------------------------------------------- //
1195
1207 template <class T>
1208 bool GetMetadata(const TfToken &key, T *value) const;
1210 USD_API
1211 bool GetMetadata(const TfToken &key, VtValue *value) const;
1212
1219 USD_API
1220 bool HasMetadata(const TfToken &key) const;
1221
1230 USD_API
1231 bool HasAuthoredMetadata(const TfToken &key) const;
1232
1241 template<typename T>
1242 bool SetMetadata(const TfToken &key, const T &value) const;
1244 USD_API
1245 bool SetMetadata(const TfToken &key, const VtValue &value) const;
1246
1255 USD_API
1256 bool ClearMetadata(const TfToken &key) const;
1257
1273 template<typename T>
1274 bool GetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1275 T* value) const;
1277 USD_API
1279 const TfToken& key, const TfToken &keyPath, VtValue *value) const;
1280
1291 USD_API
1293 const TfToken& key, const TfToken &keyPath) const;
1294
1303 USD_API
1305 const TfToken& key, const TfToken &keyPath) const;
1306
1318 template<typename T>
1319 bool SetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1320 const T& value) const;
1322 USD_API
1324 const TfToken& key, const TfToken &keyPath, const VtValue& value) const;
1325
1337 USD_API
1339 const TfToken& key, const TfToken& keyPath) const;
1340
1359 USD_API
1361
1363
1364 // --------------------------------------------------------------------- //
1371 // --------------------------------------------------------------------- //
1375 USD_API
1376 double GetStartTimeCode() const;
1377
1384 USD_API
1385 void SetStartTimeCode(double);
1386
1390 USD_API
1391 double GetEndTimeCode() const;
1392
1399 USD_API
1400 void SetEndTimeCode(double);
1401
1404 USD_API
1406
1422 USD_API
1424
1433 USD_API
1434 void SetTimeCodesPerSecond(double timeCodesPerSecond) const;
1435
1445 USD_API
1446 double GetFramesPerSecond() const;
1447
1456 USD_API
1457 void SetFramesPerSecond(double framesPerSecond) const;
1458
1460
1461 // --------------------------------------------------------------------- //
1507 // --------------------------------------------------------------------- //
1508
1514 USD_API
1515 void SetColorConfiguration(const SdfAssetPath &colorConfig) const;
1516
1521 USD_API
1523
1528 USD_API
1529 void SetColorManagementSystem(const TfToken &cms) const;
1530
1535 USD_API
1537
1549 USD_API
1550 static void GetColorConfigFallbacks(SdfAssetPath *colorConfiguration,
1551 TfToken *colorManagementSystem);
1552
1566 USD_API
1567 static void
1568 SetColorConfigFallbacks(const SdfAssetPath &colorConfiguration,
1569 const TfToken &colorManagementSystem);
1570
1572
1573 // --------------------------------------------------------------------- //
1580 // --------------------------------------------------------------------- //
1581
1586 USD_API
1588
1591 USD_API
1593
1595
1596 // --------------------------------------------------------------------- //
1601 // --------------------------------------------------------------------- //
1602
1604 USD_API
1605 std::vector<UsdPrim> GetPrototypes() const;
1606
1608
1609private:
1610 struct _IncludePayloadsPredicate;
1611
1612 // --------------------------------------------------------------------- //
1613 // Stage Construction & Initialization
1614 // --------------------------------------------------------------------- //
1615
1616 UsdStage(const SdfLayerRefPtr& rootLayer,
1617 const SdfLayerRefPtr& sessionLayer,
1618 const ArResolverContext& pathResolverContext,
1619 const UsdStagePopulationMask& mask,
1620 InitialLoadSet load);
1621
1622 // Helper for Open() overloads -- searches and publishes to bound caches.
1623 template <class... Args>
1624 static UsdStageRefPtr _OpenImpl(InitialLoadSet load, Args const &... args);
1625
1626 // Releases resources used by this stage.
1627 void _Close();
1628
1629 // Common ref ptr initialization, called by public, static constructors.
1630 //
1631 // This method will either return a valid refptr (if the stage is correctly
1632 // initialized) or it will return a null ref pointer, deleting the
1633 // raw stage pointer in the process.
1634 static UsdStageRefPtr
1635 _InstantiateStage(const SdfLayerRefPtr &rootLayer,
1636 const SdfLayerRefPtr &sessionLayer,
1637 const ArResolverContext &pathResolverContext,
1638 const UsdStagePopulationMask &mask,
1639 InitialLoadSet load);
1640
1641 // --------------------------------------------------------------------- //
1642 // Spec Existence & Definition Helpers
1643 // --------------------------------------------------------------------- //
1644
1645 SdfPropertySpecHandleVector
1646 _GetPropertyStack(const UsdProperty &prop, UsdTimeCode time) const;
1647
1648 std::vector<std::pair<SdfPropertySpecHandle, SdfLayerOffset>>
1649 _GetPropertyStackWithLayerOffsets(
1650 const UsdProperty &prop, UsdTimeCode time) const;
1651
1652 static SdfPrimSpecHandleVector
1653 _GetPrimStack(const UsdPrim &prim);
1654
1655 static std::vector<std::pair<SdfPrimSpecHandle, SdfLayerOffset>>
1656 _GetPrimStackWithLayerOffsets(const UsdPrim &prim);
1657
1659 _GetSchemaProperty(const UsdProperty &prop) const;
1660
1662 _GetSchemaAttribute(const UsdAttribute &attr) const;
1663
1665 _GetSchemaRelationship(const UsdRelationship &rel) const;
1666
1667 SdfAttributeSpecHandle
1668 _CreateNewSpecFromSchemaAttribute(
1669 const UsdPrim &prim,
1670 const UsdPrimDefinition::Attribute &attrDef);
1671
1672 SdfRelationshipSpecHandle
1673 _CreateNewSpecFromSchemaRelationship(
1674 const UsdPrim &prim,
1675 const UsdPrimDefinition::Relationship &relDef);
1676
1677 template <class PropType>
1679 _CreateNewPropertySpecFromSchema(const UsdProperty &prop);
1680
1681 SdfPrimSpecHandle
1682 _CreatePrimSpecForEditing(const UsdPrim& prim);
1683
1684 template <class PropType>
1686 _CreatePropertySpecForEditing(const UsdProperty &prop);
1687
1688 SdfPropertySpecHandle
1689 _CreatePropertySpecForEditing(const UsdProperty &prop);
1690
1691 SdfAttributeSpecHandle
1692 _CreateAttributeSpecForEditing(const UsdAttribute &attr);
1693
1694 SdfRelationshipSpecHandle
1695 _CreateRelationshipSpecForEditing(const UsdRelationship &rel);
1696
1697 // Check if the given path is valid to use with the prim creation API,
1698 // like DefinePrim. If it is valid, returns (true, GetPrimAtPath(path)).
1699 // Otherwise, returns (false, UsdPrim()).
1700 std::pair<bool, UsdPrim>
1701 _IsValidPathForCreatingPrim(const SdfPath &path) const;
1702
1703 // Validates that editing a specified prim is allowed. If editing is not
1704 // allowed, issues a coding error like "Cannot <operation> ..." and
1705 // returns false. Otherwise, returns true.
1706 bool _ValidateEditPrim(const UsdPrim &prim, const char* operation) const;
1707 bool _ValidateEditPrimAtPath(const SdfPath &primPath,
1708 const char* operation) const;
1709
1710 UsdPrim _DefinePrim(const SdfPath &path, const TfToken &typeName);
1711
1712 bool _RemoveProperty(const SdfPath& path);
1713
1714 UsdProperty _FlattenProperty(const UsdProperty &srcProp,
1715 const UsdPrim &dstParent,
1716 const TfToken &dstName);
1717
1718 // --------------------------------------------------------------------- //
1719 // Value & Metadata Authoring
1720 // --------------------------------------------------------------------- //
1721
1722 // Trait that allows us to call the correct versions of _SetValue and
1723 // _SetMetadata for types whose values need to be mapped when written to
1724 // different edit targets.
1725 template <class T>
1726 struct _IsEditTargetMappable {
1727 static const bool value =
1728 std::is_same<T, SdfTimeCode>::value ||
1729 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1730 std::is_same<T, SdfPathExpression>::value ||
1731 std::is_same<T, VtArray<SdfPathExpression>>::value ||
1732 std::is_same<T, SdfTimeSampleMap>::value ||
1733 std::is_same<T, VtDictionary>::value;
1734 };
1735
1736 // Set value for types that don't need to be mapped for edit targets.
1737 template <class T>
1738 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1739 _SetValue(
1740 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1741
1742 // Set value for types that do need to be mapped for edit targets.
1743 template <class T>
1744 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1745 _SetValue(
1746 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1747
1748 // Set value for dynamically typed VtValue. Will map the value across edit
1749 // targets if the held value type supports it.
1750 bool _SetValue(
1751 UsdTimeCode time, const UsdAttribute &attr, const VtValue &newValue);
1752
1753 template <class T>
1754 bool _SetEditTargetMappedValue(
1755 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1756
1757 template <class T>
1758 bool _SetValueImpl(
1759 UsdTimeCode time, const UsdAttribute &attr, const T& value);
1760
1761 bool _ClearValue(UsdTimeCode time, const UsdAttribute &attr);
1762
1763 // Set metadata for types that don't need to be mapped across edit targets.
1764 template <class T>
1765 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1766 _SetMetadata(const UsdObject &object, const TfToken& key,
1767 const TfToken &keyPath, const T& value);
1768
1769 // Set metadata for types that do need to be mapped for edit targets.
1770 template <class T>
1771 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1772 _SetMetadata(const UsdObject &object, const TfToken& key,
1773 const TfToken &keyPath, const T& value);
1774
1775 // Set metadata for dynamically typed VtValue. Will map the value across
1776 // edit targets if the held value type supports it.
1777 USD_API
1778 bool _SetMetadata(const UsdObject &object,
1779 const TfToken& key,
1780 const TfToken &keyPath,
1781 const VtValue& value);
1782
1783 template <class T>
1784 bool _SetEditTargetMappedMetadata(
1785 const UsdObject &obj, const TfToken& fieldName,
1786 const TfToken &keyPath, const T &newValue);
1787
1788 template <class T>
1789 bool _SetMetadataImpl(
1790 const UsdObject &obj, const TfToken& fieldName,
1791 const TfToken &keyPath, const T &value);
1792
1793 bool _ClearMetadata(const UsdObject &obj, const TfToken& fieldName,
1794 const TfToken &keyPath=TfToken());
1795
1796 // --------------------------------------------------------------------- //
1797 // Misc Internal Helpers
1798 // --------------------------------------------------------------------- //
1799
1800 // Pcp helpers.
1801 PcpCache const *_GetPcpCache() const { return _cache.get(); }
1802 PcpCache *_GetPcpCache() { return _cache.get(); }
1803
1804 // Returns the PrimIndex, using the read-only PcpCache API. We expect prims
1805 // to be composed during initial stage composition, so this method should
1806 // not be used in that context.
1807 const PcpPrimIndex* _GetPcpPrimIndex(const SdfPath& primPath) const;
1808
1809 // Helper to report pcp errors.
1810 void _ReportPcpErrors(const PcpErrorVector &errors,
1811 const std::string &context) const;
1812 void _ReportErrors(const PcpErrorVector &errors,
1813 const std::vector<std::string>& otherErrors,
1814 const std::string &context) const;
1815
1816 // --------------------------------------------------------------------- //
1817 // Scenegraph Composition & Change Processing
1818 // --------------------------------------------------------------------- //
1819
1820 // Compose the prim indexes in the subtrees rooted at the paths in
1821 // \p primIndexPaths. If \p instanceChanges is given, returns
1822 // changes to prototypes and instances due to the discovery of new instances
1823 // during composition.
1824 void _ComposePrimIndexesInParallel(
1825 const std::vector<SdfPath>& primIndexPaths,
1826 const std::string& context,
1827 Usd_InstanceChanges* instanceChanges = nullptr);
1828
1829 // Recompose the subtree rooted at \p prim: compose its type, flags, and
1830 // list of children, then invoke _ComposeSubtree on all its children.
1831 void _ComposeSubtree(
1832 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1833 UsdStagePopulationMask const *mask,
1834 const SdfPath &primIndexPath = SdfPath());
1835 void _ComposeSubtreeImpl(
1836 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1837 UsdStagePopulationMask const *mask,
1838 const SdfPath &primIndexPath = SdfPath());
1839 void _ComposeSubtreesInParallel(
1840 const std::vector<Usd_PrimDataPtr> &prims,
1841 const std::vector<SdfPath> *primIndexPaths = nullptr);
1842
1843 // Composes the full prim type info for the prim based on its type name
1844 // and applied API schemas.
1845 void _ComposePrimTypeInfoImpl(Usd_PrimDataPtr prim);
1846
1847 // Compose subtree rooted at \p prim under \p parent. This function
1848 // ensures that the appropriate prim index is specified for \p prim if
1849 // \p parent is in a prototype.
1850 void _ComposeChildSubtree(Usd_PrimDataPtr prim,
1851 Usd_PrimDataConstPtr parent,
1852 UsdStagePopulationMask const *mask);
1853
1854 // Compose \p prim's list of children and make any modifications necessary
1855 // to its _children member and the stage's _primMap, including possibly
1856 // instantiating new prims, or destroying existing subtrees of prims. The
1857 // any newly created prims *do not* have their prim index, type, flags, or
1858 // children composed.
1859 //
1860 // Compose only \p prim's direct children if recurse=false. Otherwise
1861 // recompose every descendent of \p prim. Callers that pass recurse=false
1862 // should invoke _ComposeSubtree on any newly created prims to ensure caches
1863 // are correctly populated.
1864 void _ComposeChildren(Usd_PrimDataPtr prim,
1865 UsdStagePopulationMask const *mask, bool recurse);
1866
1867 // Instantiate a prim instance. There must not already be an instance
1868 // at \p primPath.
1869 Usd_PrimDataPtr _InstantiatePrim(const SdfPath &primPath);
1870
1871 // Instantiate a prototype prim and sets its parent to pseudoroot.
1872 // There must not already be a prototype at \p primPath.
1873 Usd_PrimDataPtr _InstantiatePrototypePrim(const SdfPath &primPath);
1874
1875 // For \p prim and all of its descendants, remove from _primMap and empty
1876 // their _children vectors.
1877 void _DestroyPrim(Usd_PrimDataPtr prim);
1878
1879 // Destroy the prim subtrees rooted at each path in \p paths. \p paths may
1880 // not contain any path that is a descendent of another path in \p paths.
1881 void _DestroyPrimsInParallel(const std::vector<SdfPath>& paths);
1882
1883 // Invoke _DestroyPrim() on all of \p prim's direct children.
1884 void _DestroyDescendents(Usd_PrimDataPtr prim);
1885
1886 // Returns true if the object at the given path is a descendant of
1887 // an instance prim, i.e. a prim beneath an instance prim, or a property
1888 // of a prim beneath an instance prim.
1889 bool _IsObjectDescendantOfInstance(const SdfPath& path) const;
1890
1891 // If the given prim is an instance, returns the corresponding
1892 // prototype prim. Otherwise, returns an invalid prim.
1893 Usd_PrimDataConstPtr _GetPrototypeForInstance(Usd_PrimDataConstPtr p) const;
1894
1895 // Returns the path of the Usd prim using the prim index at the given path.
1896 SdfPath _GetPrimPathUsingPrimIndexAtPath(const SdfPath& primIndexPath) const;
1897
1898 // Update stage contents in response to changes in scene description.
1899 void _HandleLayersDidChange(const SdfNotice::LayersDidChangeSentPerLayer &);
1900
1901 // Update stage contents in response to changes to the asset resolver.
1902 void _HandleResolverDidChange(const ArNotice::ResolverChanged &);
1903
1904 // Process stage change information stored in _pendingChanges.
1905 // _pendingChanges will be set to nullptr by the end of the function.
1906 void _ProcessPendingChanges();
1907
1908 // Remove scene description for the prim at \p fullPath in the current edit
1909 // target.
1910 bool _RemovePrim(const SdfPath& fullPath);
1911
1912 SdfPrimSpecHandle _GetPrimSpec(const SdfPath& fullPath);
1913
1914 // Find and return the defining spec type for the property spec at the given
1915 // path, or SdfSpecTypeUnknown if none exists. The defining spec type is
1916 // either the builtin definition's spec type, if the indicated property is
1917 // builtin, otherwise it's the strongest authored spec's type if one exists,
1918 // otherwise it's SdfSpecTypeUnknown.
1919 SdfSpecType _GetDefiningSpecType(Usd_PrimDataConstPtr primData,
1920 const TfToken &propName) const;
1921
1922 // Helper to apply Pcp changes and recompose the scenegraph accordingly,
1923 // given an optional initial set of paths to recompose.
1924 void _Recompose(const PcpChanges &changes);
1925 template <class T>
1926 void _Recompose(const PcpChanges &changes, T *pathsToRecompose);
1927 template <class T>
1928 void _RecomposePrims(T *pathsToRecompose);
1929
1930 // Helper for _Recompose to find the subtrees that need to be
1931 // fully recomposed and to recompose the name children of the
1932 // parents of these subtrees. Note that [start, finish) must be a
1933 // sorted range of map iterators whose keys are paths with no descendent
1934 // paths. In C++20, consider using the ranges API to improve this.
1935 template <class Iter>
1936 void _ComputeSubtreesToRecompose(Iter start, Iter finish,
1937 std::vector<Usd_PrimDataPtr>* recompose);
1938
1939 // return true if the path is valid for load/unload operations.
1940 // This method will emit errors when invalid paths are encountered.
1941 bool _IsValidForLoad(const SdfPath& path) const;
1942 bool _IsValidForUnload(const SdfPath& path) const;
1943
1944 // Discover all payloads in a given subtree, adding the path of each
1945 // discovered prim index to the \p primIndexPaths set. If specified,
1946 // the corresponding UsdPrim path will be added to the \p usdPrimPaths
1947 // set. The root path will be considered for inclusion in the result set.
1948 //
1949 // Note that some payloads may not be discoverable in until an ancestral
1950 // payload has been included. UsdStage::LoadAndUnload takes this into
1951 // account.
1952 void _DiscoverPayloads(const SdfPath& rootPath,
1953 UsdLoadPolicy policy,
1954 SdfPathSet* primIndexPaths,
1955 bool unloadedOnly = false,
1956 SdfPathSet* usdPrimPaths = nullptr) const;
1957
1958 // ===================================================================== //
1959 // VALUE RESOLUTION //
1960 // ===================================================================== //
1961 // --------------------------------------------------------------------- //
1962 // Specialized Value Resolution
1963 // --------------------------------------------------------------------- //
1964
1965 // Helpers for resolving values for metadata fields requiring
1966 // special behaviors.
1967 static SdfSpecifier _GetSpecifier(Usd_PrimDataConstPtr primData);
1968 static TfToken _GetKind(Usd_PrimDataConstPtr primData);
1969 static bool _IsActive(Usd_PrimDataConstPtr primData);
1970
1971 // Custom is true if it is true anywhere in the stack.
1972 bool _IsCustom(const UsdProperty &prop) const;
1973
1974 // Variability is determined by the weakest opinion in the stack.
1975 SdfVariability _GetVariability(const UsdProperty &prop) const;
1976
1977 // Helper functions for resolving asset paths during value resolution.
1978 void _MakeResolvedAssetPaths(UsdTimeCode time, const UsdAttribute &attr,
1979 SdfAssetPath *assetPaths,
1980 size_t numAssetPaths,
1981 bool anchorAssetPathsOnly = false) const;
1982
1983 void _MakeResolvedAssetPathsValue(UsdTimeCode time, const UsdAttribute &attr,
1984 VtValue *value,
1985 bool anchorAssetPathsOnly = false) const;
1986
1987 void _MakeResolvedTimeCodes(UsdTimeCode time, const UsdAttribute &attr,
1988 SdfTimeCode *timeCodes,
1989 size_t numTimeCodes) const;
1990
1991 void _MakeResolvedPathExpressions(
1992 UsdTimeCode time, const UsdAttribute &attr,
1993 SdfPathExpression *pathExprs,
1994 size_t numPathExprs) const;
1995
1996 void _MakeResolvedAttributeValue(UsdTimeCode time, const UsdAttribute &attr,
1997 VtValue *value) const;
1998
1999 // --------------------------------------------------------------------- //
2000 // Metadata Resolution
2001 // --------------------------------------------------------------------- //
2002
2003public:
2004 // Trait that allows us to call the correct version of _GetMetadata for
2005 // types that require type specific value resolution as opposed to just
2006 // strongest opinion. These types also use type specific resolution
2007 // in _GetValue.
2008 template <class T>
2009 struct _HasTypeSpecificResolution {
2010 static const bool value =
2011 std::is_same<T, SdfAssetPath>::value ||
2012 std::is_same<T, VtArray<SdfAssetPath>>::value ||
2013 std::is_same<T, SdfTimeCode>::value ||
2014 std::is_same<T, VtArray<SdfTimeCode>>::value ||
2015 std::is_same<T, SdfPathExpression>::value ||
2016 std::is_same<T, VtArray<SdfPathExpression>>::value ||
2017 std::is_same<T, SdfTimeSampleMap>::value ||
2018 std::is_same<T, VtDictionary>::value;
2019 };
2020
2021private:
2022 // Get metadata for types that do not have type specific value resolution.
2023 template <class T>
2024 typename std::enable_if<!_HasTypeSpecificResolution<T>::value, bool>::type
2025 _GetMetadata(const UsdObject &obj,
2026 const TfToken& fieldName,
2027 const TfToken &keyPath,
2028 bool useFallbacks,
2029 T* result) const;
2030
2031 // Get metadata for types that do have type specific value resolution.
2032 template <class T>
2033 typename std::enable_if<_HasTypeSpecificResolution<T>::value, bool>::type
2034 _GetMetadata(const UsdObject &obj,
2035 const TfToken& fieldName,
2036 const TfToken &keyPath,
2037 bool useFallbacks,
2038 T* result) const;
2039
2040 // Get metadata as a dynamically typed VtValue. Will perform type specific
2041 // value resolution if the returned held type requires it.
2042 bool _GetMetadata(const UsdObject &obj,
2043 const TfToken& fieldName,
2044 const TfToken &keyPath,
2045 bool useFallbacks,
2046 VtValue* result) const;
2047
2048 // Gets a metadata value using only strongest value resolution. It is
2049 // assumed that result is holding a value that does not require type
2050 // specific value resolution.
2051 USD_API
2052 bool _GetStrongestResolvedMetadata(const UsdObject &obj,
2053 const TfToken& fieldName,
2054 const TfToken &keyPath,
2055 bool useFallbacks,
2056 SdfAbstractDataValue* result) const;
2057
2058 // Gets a metadata value with the type specific value resolution for the
2059 // type applied. This is only implemented for types that
2060 // _HasTypeSpecificResolution.
2061 template <class T>
2062 USD_API
2063 bool _GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2064 const TfToken& fieldName,
2065 const TfToken &keyPath,
2066 bool useFallbacks,
2067 T* result) const;
2068
2069 template <class Composer>
2070 void _GetAttrTypeImpl(const UsdAttribute &attr,
2071 const TfToken &fieldName,
2072 bool useFallbacks,
2073 Composer *composer) const;
2074
2075 template <class Composer>
2076 void _GetAttrVariabilityImpl(const UsdAttribute &attr,
2077 bool useFallbacks,
2078 Composer *composer) const;
2079
2080 template <class Composer>
2081 void _GetPropCustomImpl(const UsdProperty &prop,
2082 bool useFallbacks,
2083 Composer *composer) const;
2084
2085 template <class Composer>
2086 bool _GetSpecialPropMetadataImpl(const UsdObject &obj,
2087 const TfToken &fieldName,
2088 const TfToken &keyPath,
2089 bool useFallbacks,
2090 Composer *composer) const;
2091 template <class Composer>
2092 bool _GetMetadataImpl(const UsdObject &obj,
2093 const TfToken& fieldName,
2094 const TfToken& keyPath,
2095 bool includeFallbacks,
2096 Composer *composer) const;
2097
2098 template <class Composer>
2099 bool _GetGeneralMetadataImpl(const UsdObject &obj,
2100 const TfToken& fieldName,
2101 const TfToken& keyPath,
2102 bool includeFallbacks,
2103 Composer *composer) const;
2104
2105 // NOTE: The "authoredOnly" flag is not yet in use, but when we have
2106 // support for prim-based metadata fallbacks, they should be ignored when
2107 // this flag is set to true.
2108 bool _HasMetadata(const UsdObject &obj, const TfToken& fieldName,
2109 const TfToken &keyPath, bool useFallbacks) const;
2110
2112 _ListMetadataFields(const UsdObject &obj, bool useFallbacks) const;
2113
2114 void _GetAllMetadata(const UsdObject &obj,
2115 bool useFallbacks,
2116 UsdMetadataValueMap* result,
2117 bool anchorAssetPathsOnly = false) const;
2118
2119 // --------------------------------------------------------------------- //
2120 // Default & TimeSample Resolution
2121 // --------------------------------------------------------------------- //
2122
2123 void _GetResolveInfo(const UsdAttribute &attr,
2124 UsdResolveInfo *resolveInfo,
2125 const UsdTimeCode *time = nullptr) const;
2126
2127 void _GetResolveInfoWithResolveTarget(
2128 const UsdAttribute &attr,
2129 const UsdResolveTarget &resolveTarget,
2130 UsdResolveInfo *resolveInfo,
2131 const UsdTimeCode *time = nullptr) const;
2132
2133 template <class T> struct _ExtraResolveInfo;
2134
2135 // Gets the value resolve info for the given attribute. If time is provided,
2136 // the resolve info is evaluated for that specific time (which may be
2137 // default). Otherwise, if time is null, the resolve info is evaluated for
2138 // "any numeric time" and will not populate values in extraInfo that
2139 // require a specific time to be evaluated.
2140 template <class T>
2141 void _GetResolveInfo(const UsdAttribute &attr,
2142 UsdResolveInfo *resolveInfo,
2143 const UsdTimeCode *time = nullptr,
2144 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2145
2146 // Gets the value resolve info for the given attribute using the given
2147 // resolve target. If time is provided, the resolve info is evaluated for
2148 // that specific time (which may be default). Otherwise, if time is null,
2149 // the resolve info is evaluated for "any numeric time" and will not
2150 // populate values in extraInfo that require a specific time to be
2151 // evaluated.
2152 template <class T>
2153 void _GetResolveInfoWithResolveTarget(
2154 const UsdAttribute &attr,
2155 const UsdResolveTarget &resolveTarget,
2156 UsdResolveInfo *resolveInfo,
2157 const UsdTimeCode *time = nullptr,
2158 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2159
2160 // Shared implementation function for _GetResolveInfo and
2161 // _GetResolveInfoWithResolveTarget. The only difference between how these
2162 // two functions behave is in how they create the Usd_Resolver used for
2163 // iterating over nodes and layers, thus they provide this implementation
2164 // with the needed MakeUsdResolverFn to create the Usd_Resolver.
2165 template <class T, class MakeUsdResolverFn>
2166 void _GetResolveInfoImpl(const UsdAttribute &attr,
2167 UsdResolveInfo *resolveInfo,
2168 const UsdTimeCode *time,
2169 _ExtraResolveInfo<T> *extraInfo,
2170 const MakeUsdResolverFn &makeUsdResolveFn) const;
2171
2172 template <class T> struct _ResolveInfoResolver;
2173 struct _PropertyStackResolver;
2174
2175 template <class Resolver, class MakeUsdResolverFn>
2176 void _GetResolvedValueAtDefaultImpl(
2177 const UsdProperty &prop,
2178 Resolver *resolver,
2179 const MakeUsdResolverFn &makeUsdResolverFn) const;
2180
2181 template <class Resolver, class MakeUsdResolverFn>
2182 void _GetResolvedValueAtTimeImpl(
2183 const UsdProperty &prop,
2184 Resolver *resolver,
2185 const double *time,
2186 const MakeUsdResolverFn &makeUsdResolverFn) const;
2187
2188 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2189 VtValue* result) const;
2190
2191 template <class T>
2192 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2193 T* result) const;
2194
2195 template <class T>
2196 bool _GetValueImpl(UsdTimeCode time, const UsdAttribute &attr,
2197 Usd_InterpolatorBase* interpolator,
2198 T* value) const;
2199
2200 USD_API
2201 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2202 UsdTimeCode time, const UsdAttribute &attr,
2203 VtValue* result) const;
2204
2205 template <class T>
2206 USD_API
2207 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2208 UsdTimeCode time, const UsdAttribute &attr,
2209 T* result) const;
2210
2211 template <class T>
2212 bool _GetValueFromResolveInfoImpl(const UsdResolveInfo &info,
2213 UsdTimeCode time, const UsdAttribute &attr,
2214 Usd_InterpolatorBase* interpolator,
2215 T* value) const;
2216
2217 template <class T>
2218 bool _GetDefaultValueFromResolveInfoImpl(const UsdResolveInfo &info,
2219 const UsdAttribute &attr,
2220 T* value) const;
2221
2222 Usd_AssetPathContext
2223 _GetAssetPathContext(UsdTimeCode time, const UsdAttribute &attr) const;
2224
2225 // --------------------------------------------------------------------- //
2226 // Specialized Time Sample I/O
2227 // --------------------------------------------------------------------- //
2228
2235 bool _GetTimeSamplesInInterval(const UsdAttribute &attr,
2236 const GfInterval& interval,
2237 std::vector<double>* times) const;
2238
2239 bool _GetTimeSamplesInIntervalFromResolveInfo(
2240 const UsdResolveInfo &info,
2241 const UsdAttribute &attr,
2242 const GfInterval& interval,
2243 std::vector<double>* times) const;
2244
2245 size_t _GetNumTimeSamples(const UsdAttribute &attr) const;
2246
2247 size_t _GetNumTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2248 const UsdAttribute &attr) const;
2249
2253 bool _GetBracketingTimeSamples(const UsdAttribute &attr,
2254 double desiredTime,
2255 bool authoredOnly,
2256 double* lower,
2257 double* upper,
2258 bool* hasSamples) const;
2259
2260 bool _GetBracketingTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2261 const UsdAttribute &attr,
2262 double desiredTime,
2263 bool authoredOnly,
2264 double* lower,
2265 double* upper,
2266 bool* hasSamples) const;
2267
2268 bool _ValueMightBeTimeVarying(const UsdAttribute &attr) const;
2269
2270 bool _ValueMightBeTimeVaryingFromResolveInfo(const UsdResolveInfo &info,
2271 const UsdAttribute &attr) const;
2272
2273 void _RegisterPerLayerNotices();
2274 void _RegisterResolverChangeNotice();
2275
2276 // Helper to obtain a malloc tag string for this stage.
2277 inline char const *_GetMallocTagId() const;
2278
2279private:
2280
2281 // The 'pseudo root' prim.
2282 Usd_PrimDataPtr _pseudoRoot;
2283
2284 // The stage's root layer.
2285 SdfLayerRefPtr _rootLayer;
2286
2287 // Every UsdStage has an implicit, in-memory session layer.
2288 // This is to allow for runtime overrides such as variant selections.
2289 SdfLayerRefPtr _sessionLayer;
2290
2291 // The stage's EditTarget.
2292 UsdEditTarget _editTarget;
2293 bool _editTargetIsLocalLayer;
2294
2295 std::unique_ptr<PcpCache> _cache;
2296 std::unique_ptr<Usd_ClipCache> _clipCache;
2297 std::unique_ptr<Usd_InstanceCache> _instanceCache;
2298
2299 TfHashMap<TfToken, TfToken, TfHash> _invalidPrimTypeToFallbackMap;
2300
2301 size_t _usedLayersRevision;
2302
2303 // A concurrent map from Path to Prim, for fast random access.
2304 struct _TbbHashEq {
2305 inline bool equal(SdfPath const &l, SdfPath const &r) const {
2306 return l == r;
2307 }
2308 inline size_t hash(SdfPath const &path) const {
2309 return path.GetHash();
2310 }
2311 };
2312 using PathToNodeMap = tbb::concurrent_hash_map<
2313 SdfPath, Usd_PrimDataIPtr, _TbbHashEq>;
2314 PathToNodeMap _primMap;
2315
2316 // The interpolation type used for all attributes on the stage.
2317 UsdInterpolationType _interpolationType;
2318
2319 typedef std::vector<
2320 std::pair<SdfLayerHandle, TfNotice::Key> > _LayerAndNoticeKeyVec;
2321 _LayerAndNoticeKeyVec _layersAndNoticeKeys;
2322 size_t _lastChangeSerialNumber;
2323
2324 TfNotice::Key _resolverChangeKey;
2325
2326 // Data for pending change processing.
2327 class _PendingChanges;
2328 _PendingChanges* _pendingChanges;
2329
2330 std::optional<WorkDispatcher> _dispatcher;
2331
2332 // To provide useful aggregation of malloc stats, we bill everything
2333 // for this stage - from all access points - to this tag.
2334 std::unique_ptr<std::string> _mallocTagID;
2335
2336 // The state used when instantiating the stage.
2337 const InitialLoadSet _initialLoadSet;
2338
2339 // The population mask that applies to this stage.
2340 UsdStagePopulationMask _populationMask;
2341
2342 // The load rules that apply to this stage.
2343 UsdStageLoadRules _loadRules;
2344
2345 bool _isClosingStage;
2346 bool _isWritingFallbackPrimTypes;
2347
2348 friend class UsdAPISchemaBase;
2349 friend class UsdAttribute;
2350 friend class UsdAttributeQuery;
2351 friend class UsdEditTarget;
2352 friend class UsdInherits;
2353 friend class UsdObject;
2354 friend class UsdPrim;
2355 friend class UsdProperty;
2356 friend class UsdRelationship;
2357 friend class UsdSpecializes;
2358 friend class UsdVariantSet;
2359 friend class UsdVariantSets;
2360 friend class Usd_AssetPathContext;
2361 friend class Usd_FlattenAccess;
2362 friend class Usd_PcpCacheAccess;
2363 friend class Usd_PrimData;
2364 friend class Usd_StageOpenRequest;
2365 template <class T> friend struct Usd_AttrGetValueHelper;
2366 friend struct Usd_AttrGetUntypedValueHelper;
2367 template <class RefsOrPayloadsEditorType, class RefsOrPayloadsProxyType>
2368 friend struct Usd_ListEditImpl;
2369};
2370
2371// UsdObject's typed metadata query relies on this specialization being
2372// externally visible and exporting the primary template does not
2373// automatically export this specialization.
2374template <>
2375USD_API
2376bool
2377UsdStage::_GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2378 const TfToken& fieldName,
2379 const TfToken &keyPath,
2380 bool useFallbacks,
2381 SdfTimeSampleMap* result) const;
2382
2383template<typename T>
2384bool
2385UsdStage::GetMetadata(const TfToken& key, T* value) const
2386{
2387 VtValue result;
2388 if (!GetMetadata(key, &result)){
2389 return false;
2390 }
2391
2392 if (result.IsHolding<T>()){
2393 *value = result.UncheckedGet<T>();
2394 return true;
2395 } else {
2396 TF_CODING_ERROR("Requested type %s for stage metadatum %s does not"
2397 " match retrieved type %s",
2398 ArchGetDemangled<T>().c_str(),
2399 key.GetText(),
2400 result.GetTypeName().c_str());
2401 return false;
2402 }
2403}
2404
2405template<typename T>
2406bool
2407UsdStage::SetMetadata(const TfToken& key, const T& value) const
2408{
2409 VtValue in(value);
2410 return SetMetadata(key, in);
2411}
2412
2413template<typename T>
2414bool
2416 T* value) const
2417{
2418 VtValue result;
2419 if (!GetMetadataByDictKey(key, keyPath, &result)){
2420 return false;
2421 }
2422
2423 if (result.IsHolding<T>()){
2424 *value = result.UncheckedGet<T>();
2425 return true;
2426 } else {
2427 TF_CODING_ERROR("Requested type %s for stage metadatum %s[%s] does not"
2428 " match retrieved type %s",
2429 ArchGetDemangled<T>().c_str(),
2430 key.GetText(),
2431 keyPath.GetText(),
2432 result.GetTypeName().c_str());
2433 return false;
2434 }
2435}
2436
2437template<typename T>
2438bool
2440 const T& value) const
2441{
2442 VtValue in(value);
2443 return SetMetadataByDictKey(key, keyPath, in);
2444}
2445
2446// Get metadata for types that do not have type specific value resolution.
2447template <class T>
2448typename std::enable_if<
2449 !UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2450UsdStage::_GetMetadata(const UsdObject &obj,
2451 const TfToken& fieldName,
2452 const TfToken &keyPath,
2453 bool useFallbacks,
2454 T* result) const
2455{
2456 // Since these types don't have type specific value resolution, we can just
2457 // get the strongest metadata value and be done.
2458 SdfAbstractDataTypedValue<T> out(result);
2459 return _GetStrongestResolvedMetadata(
2460 obj, fieldName, keyPath, useFallbacks, &out);
2461}
2462
2463// Get metadata for types that do have type specific value resolution.
2464template <class T>
2465typename std::enable_if<
2466 UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2467UsdStage::_GetMetadata(const UsdObject &obj,
2468 const TfToken& fieldName,
2469 const TfToken &keyPath,
2470 bool useFallbacks,
2471 T* result) const
2472{
2473 // Call the templated type specifice resolved metadata implementation that
2474 // will only be implemented for types that support it.
2475 return _GetTypeSpecificResolvedMetadata(
2476 obj, fieldName, keyPath, useFallbacks, result);
2477}
2478
2479
2480// Set metadata for types that don't need to be mapped across edit targets.
2481template <class T>
2482typename std::enable_if<!UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2483UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2484 const TfToken &keyPath, const T& value)
2485{
2486 // Since we know that we don't need to map the value for edit targets,
2487 // we can just type erase the value and set the metadata as is.
2489 return _SetMetadataImpl<SdfAbstractDataConstValue>(
2490 object, key, keyPath, in);
2491}
2492
2493// Set metadata for types that do need to be mapped for edit targets.
2494template <class T>
2495typename std::enable_if<UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2496UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2497 const TfToken &keyPath, const T& value)
2498{
2499 return _SetEditTargetMappedMetadata(object, key, keyPath, value);
2500}
2501
2502PXR_NAMESPACE_CLOSE_SCOPE
2503
2504#endif //PXR_USD_USD_STAGE_H
2505
Notice sent when asset paths may resolve to a different path than before due to a change in the resol...
Definition: notice.h:50
An asset resolver context allows clients to provide additional data to the resolver for use during re...
A basic mathematical interval class.
Definition: interval.h:33
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:77
Describes Pcp changes.
Definition: changes.h:176
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
Definition: primIndex.h:61
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:545
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:450
A type-erased container for a field value in an SdfAbstractData.
Definition: abstractData.h:399
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check...
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:83
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
Definition: layer.h:106
Notice sent per-layer indicating all layers whose contents have changed within a single round of chan...
Definition: notice.h:94
Objects of this class represent a logical expression syntax tree consisting of SdfPathPattern s,...
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
Value type that represents a time code.
Definition: timeCode.h:28
Stores a pointer to a ValueType which uses TfDelegatedCountIncrement and TfDelegatedCountDecrement to...
Handle-object returned by TfNotice::Register().
Definition: notice.h:239
Enable a concrete base class for use with TfRefPtr.
Definition: refBase.h:56
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
char const * GetText() const
Return the text that this token represents.
Definition: token.h:179
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:124
The base class for all API schemas.
Definition: apiSchemaBase.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:159
Object for efficiently making repeated queries for attribute values.
Defines a mapping from scene graph paths to Sdf spec paths in a SdfLayer where edits should be direct...
Definition: editTarget.h:62
A proxy class for applying listOp edits to the inherit paths list for a prim.
Definition: inherits.h:34
Base class for Usd scenegraph objects, providing common API.
Definition: object.h:115
Accessor to a attribute's definition in the prim definition.
Accessor to a property's definition in the prim definition.
Accessor to a relationship's definition in the prim definition.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
Definition: primRange.h:102
Base class for UsdAttribute and UsdRelationship scenegraph objects.
Definition: property.h:38
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
Container for information about the source of an attribute's value, i.e.
Definition: resolveInfo.h:52
Defines a subrange of nodes and layers within a prim's prim index to consider when performing value r...
Definition: resolveTarget.h:56
A proxy class for applying listOp edits to the specializes list for a prim.
Definition: specializes.h:34
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
Definition: stage.h:134
USD_API void SetEndTimeCode(double)
Sets the stage's end timeCode.
USD_API bool SetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, const VtValue &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API void LoadAndUnload(const SdfPathSet &loadSet, const SdfPathSet &unloadSet, UsdLoadPolicy policy=UsdLoadWithDescendants)
Unload and load the given path sets.
USD_API void WriteFallbackPrimTypes()
Writes the fallback prim types defined in the schema registry to the stage as dictionary valued fallb...
static USD_API void SetColorConfigFallbacks(const SdfAssetPath &colorConfiguration, const TfToken &colorManagementSystem)
Sets the global fallback values of color configuration metadata which includes the 'colorConfiguratio...
static USD_API UsdStageRefPtr Open(const SdfLayerHandle &rootLayer, const SdfLayerHandle &sessionLayer, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API bool ExportToString(std::string *result, bool addSourceFileComment=true) const
Writes the composite scene as a flattened Usd text representation into the given string.
bool SetMetadata(const TfToken &key, const T &value) const
Set the value of Stage metadatum key to value, if the stage's current UsdEditTarget is the root or se...
Definition: stage.h:2407
static USD_API UsdStageRefPtr OpenMasked(const SdfLayerHandle &rootLayer, const UsdStagePopulationMask &mask, InitialLoadSet load=LoadAll)
Open a stage rooted at rootLayer and with limited population subject to mask.
static USD_API UsdStageRefPtr CreateNew(const std::string &identifier, const SdfLayerHandle &sessionLayer, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API std::vector< UsdPrim > GetPrototypes() const
Returns all native instancing prototype prims.
USD_API bool HasAuthoredMetadataDictKey(const TfToken &key, const TfToken &keyPath) const
Return true if there exists any authored opinion (excluding fallbacks) for key and keyPath.
USD_API UsdPrim OverridePrim(const SdfPath &path)
Attempt to ensure a UsdPrim at path exists on this stage.
USD_API void SetPopulationMask(UsdStagePopulationMask const &mask)
Set this stage's population mask and recompose the stage.
USD_API void UnmuteLayer(const std::string &layerIdentifier)
Unmute the layer identified by layerIdentifier if it had previously been muted.
USD_API SdfPathSet GetLoadSet()
Returns a set of all loaded paths.
USD_API PcpErrorVector GetCompositionErrors() const
Return a PcpErrorVector containing all composition errors encountered when composing the prims and la...
static USD_API PcpVariantFallbackMap GetGlobalVariantFallbacks()
Get the global variant fallback preferences used in new UsdStages.
USD_API void ExpandPopulationMask(std::function< bool(UsdRelationship const &)> const &relPred=nullptr, std::function< bool(UsdAttribute const &)> const &attrPred=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API bool HasAuthoredMetadata(const TfToken &key) const
Returns true if the key has an authored value, false if no value was authored or the only value avail...
USD_API UsdEditTarget GetEditTargetForLocalLayer(size_t i)
Return a UsdEditTarget for editing the layer at index i in the layer stack.
USD_API SdfLayerHandleVector GetUsedLayers(bool includeClipLayers=true) const
Return a vector of all of the layers currently consumed by this stage, as determined by the compositi...
USD_API bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, VtValue *value) const
overload
USD_API double GetEndTimeCode() const
Returns the stage's end timeCode.
static USD_API UsdStageRefPtr CreateInMemory(const std::string &identifier, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
UsdStagePopulationMask GetPopulationMask() const
Return this stage's population mask.
Definition: stage.h:653
USD_API bool Export(const std::string &filename, bool addSourceFileComment=true, const SdfLayer::FileFormatArguments &args=SdfLayer::FileFormatArguments()) const
Writes out the composite scene as a single flattened layer into filename.
static USD_API UsdStageRefPtr CreateNew(const std::string &identifier, InitialLoadSet load=LoadAll)
Create a new stage with root layer identifier, destroying potentially existing files with that identi...
USD_API UsdPrim GetPseudoRoot() const
Return the stage's "pseudo-root" prim, whose name is defined by Usd.
USD_API double GetFramesPerSecond() const
Returns the stage's framesPerSecond value.
USD_API std::string ResolveIdentifierToEditTarget(std::string const &identifier) const
Resolve the given identifier using this stage's ArResolverContext and the layer of its GetEditTarget(...
USD_API void ExpandPopulationMask(Usd_PrimFlagsPredicate const &traversalPredicate, std::function< bool(UsdRelationship const &)> const &relPred=nullptr, std::function< bool(UsdAttribute const &)> const &attrPred=nullptr)
Expand this stage's population mask to include the targets of all relationships that pass relPred and...
USD_API UsdProperty GetPropertyAtPath(const SdfPath &path) const
Return the UsdProperty at path, or an invalid UsdProperty if none exists.
static USD_API UsdStageRefPtr CreateInMemory(const std::string &identifier, const SdfLayerHandle &sessionLayer, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API UsdPrim DefinePrim(const SdfPath &path, const TfToken &typeName=TfToken())
Attempt to ensure a UsdPrim at path is defined (according to UsdPrim::IsDefined()) on this stage.
USD_API void SetTimeCodesPerSecond(double timeCodesPerSecond) const
Sets the stage's timeCodesPerSecond value.
USD_API UsdAttribute GetAttributeAtPath(const SdfPath &path) const
Return the UsdAttribute at path, or an invalid UsdAttribute if none exists.
USD_API UsdPrim GetDefaultPrim() const
Return the UsdPrim on this stage whose path is the root layer's defaultPrim metadata's value.
USD_API bool HasDefaultPrim() const
Return true if this stage's root layer has an authored opinion for the default prim layer metadata.
USD_API UsdPrimRange Traverse(const Usd_PrimFlagsPredicate &predicate)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USD_API void GetColorConfigFallbacks(SdfAssetPath *colorConfiguration, TfToken *colorManagementSystem)
Returns the global fallback values of 'colorConfiguration' and 'colorManagementSystem'.
USD_API UsdPrim GetPrimAtPath(const SdfPath &path) const
Return the UsdPrim at path, or an invalid UsdPrim if none exists.
USD_API UsdInterpolationType GetInterpolationType() const
Returns the interpolation type used during value resolution for all attributes on this stage.
USD_API UsdPrimRange TraverseAll()
Traverse all the prims on this stage depth-first.
USD_API bool IsLayerMuted(const std::string &layerIdentifier) const
Returns true if the layer specified by layerIdentifier is muted in this cache, false otherwise.
USD_API void SetColorManagementSystem(const TfToken &cms) const
Sets the name of the color management system used to interpret the color configuration file pointed a...
USD_API void ClearDefaultPrim()
Clear the default prim layer metadata in this stage's root layer.
InitialLoadSet
Specifies the initial set of prims to load when opening a UsdStage.
Definition: stage.h:148
@ LoadAll
Load all loadable prims.
Definition: stage.h:149
@ LoadNone
Load no loadable prims.
Definition: stage.h:150
bool SetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, const T &value) const
Author value to the field identified by key and keyPath at the current EditTarget.
Definition: stage.h:2439
static USD_API UsdStageRefPtr CreateNew(const std::string &identifier, const SdfLayerHandle &sessionLayer, const ArResolverContext &pathResolverContext, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USD_API UsdStageRefPtr CreateInMemory(InitialLoadSet load=LoadAll)
Creates a new stage only in memory, analogous to creating an anonymous SdfLayer.
USD_API void SetDefaultPrim(const UsdPrim &prim)
Set the default prim layer metadata in this stage's root layer.
USD_API double GetTimeCodesPerSecond() const
Returns the stage's timeCodesPerSecond value.
static USD_API UsdStageRefPtr OpenMasked(const SdfLayerHandle &rootLayer, const SdfLayerHandle &sessionLayer, const ArResolverContext &pathResolverContext, const UsdStagePopulationMask &mask, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API double GetStartTimeCode() const
Returns the stage's start timeCode.
USD_API void MuteLayer(const std::string &layerIdentifier)
Mute the layer identified by layerIdentifier.
USD_API const std::vector< std::string > & GetMutedLayers() const
Returns a vector of all layers that have been muted on this stage.
USD_API bool HasMetadataDictKey(const TfToken &key, const TfToken &keyPath) const
Return true if there exists any authored or fallback opinion for key and keyPath.
USD_API UsdPrim CreateClassPrim(const SdfPath &rootPrimPath)
Author an SdfPrimSpec with specifier == SdfSpecifierClass for the class at root prim path path at the...
USD_API void SaveSessionLayers()
Calls SdfLayer::Save on all dirty session layers and sublayers of session layers contributing to this...
static USD_API UsdStageRefPtr CreateInMemory(const std::string &identifier, const SdfLayerHandle &sessionLayer, const ArResolverContext &pathResolverContext, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USD_API UsdStageRefPtr OpenMasked(const SdfLayerHandle &rootLayer, const ArResolverContext &pathResolverContext, const UsdStagePopulationMask &mask, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API UsdObject GetObjectAtPath(const SdfPath &path) const
Return the UsdObject at path, or an invalid UsdObject if none exists.
USD_API SdfLayerHandleVector GetLayerStack(bool includeSessionLayers=true) const
includeSessionLayers is true, return the linearized strong-to-weak sublayers rooted at the stage's se...
static USD_API UsdStageRefPtr CreateNew(const std::string &identifier, const ArResolverContext &pathResolverContext, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USD_API bool IsSupportedFile(const std::string &filePath)
Indicates whether the specified file is supported by UsdStage.
static USD_API UsdStageRefPtr CreateInMemory(const std::string &identifier, const ArResolverContext &pathResolverContext, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API void MuteAndUnmuteLayers(const std::vector< std::string > &muteLayers, const std::vector< std::string > &unmuteLayers)
Mute and unmute the layers identified in muteLayers and unmuteLayers.
USD_API void SetColorConfiguration(const SdfAssetPath &colorConfig) const
Sets the default color configuration to be used to interpret the per-attribute color-spaces in the co...
USD_API bool HasLocalLayer(const SdfLayerHandle &layer) const
Return true if layer is one of the layers in this stage's local, root layerStack.
USD_API void SetFramesPerSecond(double framesPerSecond) const
Sets the stage's framesPerSecond value.
static USD_API UsdStageRefPtr Open(const SdfLayerHandle &rootLayer, const ArResolverContext &pathResolverContext, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
Resolve the requested dictionary sub-element keyPath of dictionary-valued metadatum named key,...
Definition: stage.h:2415
USD_API SdfAssetPath GetColorConfiguration() const
Returns the default color configuration used to interpret the per- attribute color-spaces in the comp...
USD_API bool SetMetadata(const TfToken &key, const VtValue &value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USD_API UsdStageRefPtr Open(const std::string &filePath, InitialLoadSet load=LoadAll)
Attempt to find a matching existing stage in a cache if UsdStageCacheContext objects exist on the sta...
USD_API void Reload()
Calls SdfLayer::Reload on all layers contributing to this stage, except session layers and sublayers ...
USD_API bool RemovePrim(const SdfPath &path)
Remove all scene description for the given path and its subtree in the current UsdEditTarget.
USD_API bool HasAuthoredTimeCodeRange() const
Returns true if the stage has both start and end timeCodes authored in the session layer or the root ...
USD_API void SetEditTarget(const UsdEditTarget &editTarget)
Set the stage's EditTarget.
USD_API UsdEditTarget GetEditTargetForLocalLayer(const SdfLayerHandle &layer)
Return a UsdEditTarget for editing the given local layer.
USD_API void SetLoadRules(UsdStageLoadRules const &rules)
Set the UsdStageLoadRules to govern payload inclusion on this stage.
USD_API void SetInterpolationType(UsdInterpolationType interpolationType)
Sets the interpolation type used during value resolution for all attributes on this stage.
bool GetMetadata(const TfToken &key, T *value) const
Return in value an authored or fallback value (if one was defined for the given metadatum) for Stage ...
Definition: stage.h:2385
static USD_API UsdStageRefPtr Open(const SdfLayerHandle &rootLayer, InitialLoadSet load=LoadAll)
Open a stage rooted at rootLayer.
static USD_API UsdStageRefPtr OpenMasked(const std::string &filePath, const ArResolverContext &pathResolverContext, UsdStagePopulationMask const &mask, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USD_API UsdStageRefPtr Open(const std::string &filePath, const ArResolverContext &pathResolverContext, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API ArResolverContext GetPathResolverContext() const
Return the path resolver context for all path resolution during composition of this stage.
USD_API TfToken GetColorManagementSystem() const
Sets the name of the color management system to be used for loading and interpreting the color config...
USD_API UsdPrimRange Traverse()
Traverse the active, loaded, defined, non-abstract prims on this stage depth-first.
UsdStageLoadRules const & GetLoadRules() const
Return the stage's current UsdStageLoadRules governing payload inclusion.
Definition: stage.h:636
static USD_API void SetGlobalVariantFallbacks(const PcpVariantFallbackMap &fallbacks)
Set the global variant fallback preferences used in new UsdStages.
static USD_API UsdStageRefPtr OpenMasked(const std::string &filePath, UsdStagePopulationMask const &mask, InitialLoadSet load=LoadAll)
Create a new stage and recursively compose prims defined within and referenced by the layer at filePa...
USD_API void Save()
Calls SdfLayer::Save on all dirty layers contributing to this stage except session layers and sublaye...
USD_API SdfPathSet FindLoadable(const SdfPath &rootPath=SdfPath::AbsoluteRootPath())
Returns an SdfPathSet of all paths that can be loaded.
USD_API bool HasMetadata(const TfToken &key) const
Returns true if the key has a meaningful value, that is, if GetMetadata() will provide a value,...
USD_API SdfLayerRefPtr Flatten(bool addSourceFileComment=true) const
Returns a single, anonymous, merged layer for this composite scene.
USD_API SdfLayerHandle GetRootLayer() const
Return this stage's root layer.
static USD_API UsdStageRefPtr OpenMasked(const SdfLayerHandle &rootLayer, const SdfLayerHandle &sessionLayer, const UsdStagePopulationMask &mask, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API UsdRelationship GetRelationshipAtPath(const SdfPath &path) const
Return the UsdAttribute at path, or an invalid UsdAttribute if none exists.
USD_API UsdPrim Load(const SdfPath &path=SdfPath::AbsoluteRootPath(), UsdLoadPolicy policy=UsdLoadWithDescendants)
Modify this stage's load rules to load the prim at path, its ancestors, and all of its descendants if...
USD_API void Unload(const SdfPath &path=SdfPath::AbsoluteRootPath())
Modify this stage's load rules to unload the prim and its descendants specified by path.
USD_API void SetStartTimeCode(double)
Sets the stage's start timeCode.
USD_API bool GetMetadata(const TfToken &key, VtValue *value) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USD_API UsdStageRefPtr Open(const SdfLayerHandle &rootLayer, const SdfLayerHandle &sessionLayer, const ArResolverContext &pathResolverContext, InitialLoadSet load=LoadAll)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API bool ClearMetadata(const TfToken &key) const
Clear the value of stage metadatum key, if the stage's current UsdEditTarget is the root or session l...
USD_API SdfLayerHandle GetSessionLayer() const
Return this stage's root session layer.
USD_API const UsdEditTarget & GetEditTarget() const
Return the stage's EditTarget.
USD_API bool ClearMetadataByDictKey(const TfToken &key, const TfToken &keyPath) const
Clear any authored value identified by key and keyPath at the current EditTarget.
This class represents rules that govern payload inclusion on UsdStages.
This class represents a mask that may be applied to a UsdStage to limit the set of UsdPrim s it popul...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:67
A UsdVariantSet represents a single VariantSet in USD (e.g.
Definition: variantSets.h:39
UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim.
Definition: variantSets.h:205
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
VT_API std::string GetTypeName() const
Return the type name of the held typeid.
bool IsHolding() const
Return true if this value is holding an object of type T, false otherwise.
Definition: value.h:1064
T const & UncheckedGet() const &
Returns a const reference to the held object if the held object is of type T.
Definition: value.h:1104
UsdLoadPolicy
Controls UsdStage::Load() and UsdPrim::Load() behavior regarding whether or not descendant prims are ...
Definition: common.h:99
@ UsdLoadWithDescendants
Load a prim plus all its descendants.
Definition: common.h:101
Standard pointer typedefs.
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
Definition: diagnostic.h:68
UsdInterpolationType
Attribute value interpolation options.
Definition: interpolation.h:28
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
Definition: types.h:189
Basic Sdf data types.
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:68
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
Definition: types.h:100
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:156
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:277