All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"
25#include "pxr/base/tf/type.h"
27
28#include "pxr/usd/ar/ar.h"
29#include "pxr/usd/ar/notice.h"
31#include "pxr/usd/sdf/notice.h"
32#include "pxr/usd/sdf/path.h"
33#include "pxr/usd/sdf/types.h"
34#include "pxr/usd/pcp/cache.h"
35#include "pxr/base/vt/value.h"
37
38#include <tbb/concurrent_vector.h>
39#include <tbb/concurrent_unordered_set.h>
40#include <tbb/concurrent_hash_map.h>
41#include <tbb/spin_rw_mutex.h>
42
43#include <functional>
44#include <string>
45#include <memory>
46#include <optional>
47#include <unordered_map>
48#include <utility>
49
50PXR_NAMESPACE_OPEN_SCOPE
51
53class GfInterval;
55class TsSpline;
56class Usd_AssetPathContext;
57class Usd_ClipCache;
58class Usd_InstanceCache;
59class Usd_InstanceChanges;
60class Usd_InterpolatorBase;
61class Usd_Resolver;
62class UsdResolveInfo;
64class UsdPrim;
65class UsdPrimRange;
66
67SDF_DECLARE_HANDLES(SdfLayer);
68
136class UsdStage : public TfRefBase, public TfWeakBase {
137public:
138
139 // --------------------------------------------------------------------- //
143 // --------------------------------------------------------------------- //
144
150 {
152 LoadNone
153 };
154
165 //
177 USD_API
178 static UsdStageRefPtr
179 CreateNew(const std::string& identifier,
180 InitialLoadSet load = LoadAll);
182 USD_API
183 static UsdStageRefPtr
184 CreateNew(const std::string& identifier,
185 const SdfLayerHandle& sessionLayer,
186 InitialLoadSet load = LoadAll);
188 USD_API
189 static UsdStageRefPtr
190 CreateNew(const std::string& identifier,
191 const SdfLayerHandle& sessionLayer,
192 const ArResolverContext& pathResolverContext,
193 InitialLoadSet load = LoadAll);
195 USD_API
196 static UsdStageRefPtr
197 CreateNew(const std::string& identifier,
198 const ArResolverContext& pathResolverContext,
199 InitialLoadSet load = LoadAll);
200
218 USD_API
219 static UsdStageRefPtr
222 USD_API
223 static UsdStageRefPtr
224 CreateInMemory(const std::string& identifier,
225 InitialLoadSet load = LoadAll);
227 USD_API
228 static UsdStageRefPtr
229 CreateInMemory(const std::string& identifier,
230 const ArResolverContext& pathResolverContext,
231 InitialLoadSet load = LoadAll);
233 USD_API
234 static UsdStageRefPtr
235 CreateInMemory(const std::string& identifier,
236 const SdfLayerHandle &sessionLayer,
237 InitialLoadSet load = LoadAll);
239 USD_API
240 static UsdStageRefPtr
241 CreateInMemory(const std::string& identifier,
242 const SdfLayerHandle &sessionLayer,
243 const ArResolverContext& pathResolverContext,
244 InitialLoadSet load = LoadAll);
245
261 USD_API
262 static UsdStageRefPtr
263 Open(const std::string& filePath, InitialLoadSet load = LoadAll);
265 USD_API
266 static UsdStageRefPtr
267 Open(const std::string& filePath,
268 const ArResolverContext& pathResolverContext,
269 InitialLoadSet load = LoadAll);
270
288 USD_API
289 static UsdStageRefPtr
290 OpenMasked(const std::string &filePath,
291 UsdStagePopulationMask const &mask,
292 InitialLoadSet load = LoadAll);
294 USD_API
295 static UsdStageRefPtr
296 OpenMasked(const std::string &filePath,
297 const ArResolverContext &pathResolverContext,
298 UsdStagePopulationMask const &mask,
299 InitialLoadSet load = LoadAll);
300
329 USD_API
330 static UsdStageRefPtr
331 Open(const SdfLayerHandle& rootLayer,
334 USD_API
335 static UsdStageRefPtr
336 Open(const SdfLayerHandle& rootLayer,
337 const SdfLayerHandle& sessionLayer,
340 USD_API
341 static UsdStageRefPtr
342 Open(const SdfLayerHandle& rootLayer,
343 const ArResolverContext& pathResolverContext,
346 USD_API
347 static UsdStageRefPtr
348 Open(const SdfLayerHandle& rootLayer,
349 const SdfLayerHandle& sessionLayer,
350 const ArResolverContext& pathResolverContext,
352
373 USD_API
374 static UsdStageRefPtr
375 OpenMasked(const SdfLayerHandle& rootLayer,
376 const UsdStagePopulationMask &mask,
379 USD_API
380 static UsdStageRefPtr
381 OpenMasked(const SdfLayerHandle& rootLayer,
382 const SdfLayerHandle& sessionLayer,
383 const UsdStagePopulationMask &mask,
386 USD_API
387 static UsdStageRefPtr
388 OpenMasked(const SdfLayerHandle& rootLayer,
389 const ArResolverContext& pathResolverContext,
390 const UsdStagePopulationMask &mask,
393 USD_API
394 static UsdStageRefPtr
395 OpenMasked(const SdfLayerHandle& rootLayer,
396 const SdfLayerHandle& sessionLayer,
397 const ArResolverContext& pathResolverContext,
398 const UsdStagePopulationMask &mask,
400
401 USD_API
402 virtual ~UsdStage();
403
421 USD_API
422 void Reload();
423
432 USD_API
433 static bool
434 IsSupportedFile(const std::string& filePath);
435
437
438 // --------------------------------------------------------------------- //
447
455 USD_API
456 void Save();
457
465 USD_API
467
469
470 // --------------------------------------------------------------------- //
516
518 USD_API
520
526 USD_API
527 static void
529
531
532 // --------------------------------------------------------------------- //
561 // --------------------------------------------------------------------- //
562
570 USD_API
573
579 USD_API
581
593 USD_API
594 void LoadAndUnload(const SdfPathSet &loadSet, const SdfPathSet &unloadSet,
596
607 USD_API
608 SdfPathSet GetLoadSet();
609
629 USD_API
630 SdfPathSet FindLoadable(
631 const SdfPath& rootPath = SdfPath::AbsoluteRootPath());
632
639 return _loadRules;
640 }
641
651 USD_API
652 void SetLoadRules(UsdStageLoadRules const &rules);
653
656 return _populationMask;
657 }
658
660 USD_API
662
676 USD_API
678 Usd_PrimFlagsPredicate const &traversalPredicate,
679 std::function<bool (UsdRelationship const &)> const &relPred = nullptr,
680 std::function<bool (UsdAttribute const &)> const &attrPred = nullptr);
681
685 USD_API
687 std::function<bool (UsdRelationship const &)> const &relPred = nullptr,
688 std::function<bool (UsdAttribute const &)> const &attrPred = nullptr);
689
691
692 // --------------------------------------------------------------------- //
701 // --------------------------------------------------------------------- //
702
712 USD_API
714
722 USD_API
724
736 USD_API
737 void SetDefaultPrim(const UsdPrim &prim);
738
746 USD_API
748
756 USD_API
757 bool HasDefaultPrim() const;
758
768 USD_API
769 UsdPrim GetPrimAtPath(const SdfPath &path) const;
770
795 USD_API
797
806 USD_API
808
817 USD_API
819
828 USD_API
830private:
831 // Return the primData object at \p path.
832 Usd_PrimDataConstPtr _GetPrimDataAtPath(const SdfPath &path) const;
833 Usd_PrimDataPtr _GetPrimDataAtPath(const SdfPath &path);
834
835 // Return the primData object at \p path. If \p path indicates a prim
836 // beneath an instance, return the primData object for the corresponding
837 // prim in the instance's prototype.
838 Usd_PrimDataConstPtr
839 _GetPrimDataAtPathOrInPrototype(const SdfPath &path) const;
840
842 std::vector<UsdPrim>
843 _GetInstancesForPrototype(const UsdPrim& prototype) const;
844
845public:
846
867 USD_API
869
874 USD_API
875 UsdPrimRange Traverse(const Usd_PrimFlagsPredicate &predicate);
876
881 USD_API
883
902 USD_API
904
928 USD_API
930 const TfToken &typeName=TfToken());
931
944 USD_API
945 UsdPrim CreateClassPrim(const SdfPath &rootPrimPath);
946
968 USD_API
969 bool RemovePrim(const SdfPath& path);
970
972
973 // --------------------------------------------------------------------- //
977 // --------------------------------------------------------------------- //
978
980 USD_API
981 SdfLayerHandle GetSessionLayer() const;
982
984 USD_API
985 SdfLayerHandle GetRootLayer() const;
986
991 USD_API
993
1003 USD_API
1004 std::string
1005 ResolveIdentifierToEditTarget(std::string const &identifier) const;
1006
1009 USD_API
1010 PcpErrorVector GetCompositionErrors() const;
1011
1017 USD_API
1018 SdfLayerHandleVector GetLayerStack(bool includeSessionLayers=true) const;
1019
1031 USD_API
1032 SdfLayerHandleVector GetUsedLayers(bool includeClipLayers=true) const;
1033
1036 USD_API
1037 bool HasLocalLayer(const SdfLayerHandle &layer) const;
1038
1040 USD_API
1042
1046 USD_API
1048
1052 USD_API
1053 UsdEditTarget GetEditTargetForLocalLayer(const SdfLayerHandle &layer);
1054
1061 USD_API
1062 void SetEditTarget(const UsdEditTarget &editTarget);
1063
1090 USD_API
1091 void MuteLayer(const std::string &layerIdentifier);
1092
1095 USD_API
1096 void UnmuteLayer(const std::string &layerIdentifier);
1097
1105 USD_API
1106 void MuteAndUnmuteLayers(const std::vector<std::string> &muteLayers,
1107 const std::vector<std::string> &unmuteLayers);
1108
1110 USD_API
1111 const std::vector<std::string>& GetMutedLayers() const;
1112
1117 USD_API
1118 bool IsLayerMuted(const std::string& layerIdentifier) const;
1119
1121
1122 // --------------------------------------------------------------------- //
1126 // --------------------------------------------------------------------- //
1127 // Future Work:
1128 // * Flatten sub-trees or individual prims
1129 // * Allow flattening of local LayerStack
1130 // * Move Flatten into a free-function to ensure it doesn't rely on
1131 // Stage internals.
1132
1140 USD_API
1141 bool Export(const std::string &filename,
1142 bool addSourceFileComment=true,
1143 const SdfLayer::FileFormatArguments &args =
1145
1153 USD_API
1154 bool ExportToString(std::string *result,
1155 bool addSourceFileComment=true) const;
1156
1183 USD_API
1184 SdfLayerRefPtr Flatten(bool addSourceFileComment=true) const;
1186
1187public:
1188 // --------------------------------------------------------------------- //
1196 // --------------------------------------------------------------------- //
1197
1209 template <class T>
1210 bool GetMetadata(const TfToken &key, T *value) const;
1212 USD_API
1213 bool GetMetadata(const TfToken &key, VtValue *value) const;
1214
1221 USD_API
1222 bool HasMetadata(const TfToken &key) const;
1223
1232 USD_API
1233 bool HasAuthoredMetadata(const TfToken &key) const;
1234
1243 template<typename T>
1244 bool SetMetadata(const TfToken &key, const T &value) const;
1246 USD_API
1247 bool SetMetadata(const TfToken &key, const VtValue &value) const;
1248
1257 USD_API
1258 bool ClearMetadata(const TfToken &key) const;
1259
1275 template<typename T>
1276 bool GetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1277 T* value) const;
1279 USD_API
1281 const TfToken& key, const TfToken &keyPath, VtValue *value) const;
1282
1293 USD_API
1295 const TfToken& key, const TfToken &keyPath) const;
1296
1305 USD_API
1307 const TfToken& key, const TfToken &keyPath) const;
1308
1320 template<typename T>
1321 bool SetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1322 const T& value) const;
1324 USD_API
1326 const TfToken& key, const TfToken &keyPath, const VtValue& value) const;
1327
1339 USD_API
1341 const TfToken& key, const TfToken& keyPath) const;
1342
1361 USD_API
1363
1365
1366 // --------------------------------------------------------------------- //
1373 // --------------------------------------------------------------------- //
1377 USD_API
1378 double GetStartTimeCode() const;
1379
1386 USD_API
1387 void SetStartTimeCode(double);
1388
1392 USD_API
1393 double GetEndTimeCode() const;
1394
1401 USD_API
1402 void SetEndTimeCode(double);
1403
1406 USD_API
1408
1424 USD_API
1426
1435 USD_API
1436 void SetTimeCodesPerSecond(double timeCodesPerSecond) const;
1437
1447 USD_API
1448 double GetFramesPerSecond() const;
1449
1458 USD_API
1459 void SetFramesPerSecond(double framesPerSecond) const;
1460
1462
1463 // --------------------------------------------------------------------- //
1484 // --------------------------------------------------------------------- //
1485
1491 USD_API
1492 void SetColorConfiguration(const SdfAssetPath &colorConfig) const;
1493
1497 USD_API
1499
1504 USD_API
1505 void SetColorManagementSystem(const TfToken &cms) const;
1506
1511 USD_API
1513
1524 USD_API
1525 static void GetColorConfigFallbacks(SdfAssetPath *colorConfiguration,
1526 TfToken *colorManagementSystem);
1527
1541 USD_API
1542 static void
1543 SetColorConfigFallbacks(const SdfAssetPath &colorConfiguration,
1544 const TfToken &colorManagementSystem);
1545
1547
1548 // --------------------------------------------------------------------- //
1555 // --------------------------------------------------------------------- //
1556
1561 USD_API
1563
1566 USD_API
1568
1570
1571 // --------------------------------------------------------------------- //
1576 // --------------------------------------------------------------------- //
1577
1579 USD_API
1580 std::vector<UsdPrim> GetPrototypes() const;
1581
1583
1584private:
1585 struct _IncludePayloadsPredicate;
1586
1587 // --------------------------------------------------------------------- //
1588 // Stage Construction & Initialization
1589 // --------------------------------------------------------------------- //
1590
1591 UsdStage(const SdfLayerRefPtr& rootLayer,
1592 const SdfLayerRefPtr& sessionLayer,
1593 const ArResolverContext& pathResolverContext,
1594 const UsdStagePopulationMask& mask,
1595 InitialLoadSet load);
1596
1597 // Helper for Open() overloads -- searches and publishes to bound caches.
1598 template <class... Args>
1599 static UsdStageRefPtr _OpenImpl(InitialLoadSet load, Args const &... args);
1600
1601 // Releases resources used by this stage.
1602 void _Close();
1603
1604 // Common ref ptr initialization, called by public, static constructors.
1605 //
1606 // This method will either return a valid refptr (if the stage is correctly
1607 // initialized) or it will return a null ref pointer, deleting the
1608 // raw stage pointer in the process.
1609 static UsdStageRefPtr
1610 _InstantiateStage(const SdfLayerRefPtr &rootLayer,
1611 const SdfLayerRefPtr &sessionLayer,
1612 const ArResolverContext &pathResolverContext,
1613 const UsdStagePopulationMask &mask,
1614 InitialLoadSet load);
1615
1616 // --------------------------------------------------------------------- //
1617 // Spec Existence & Definition Helpers
1618 // --------------------------------------------------------------------- //
1619
1620 SdfPropertySpecHandleVector
1621 _GetPropertyStack(const UsdProperty &prop, UsdTimeCode time) const;
1622
1623 std::vector<std::pair<SdfPropertySpecHandle, SdfLayerOffset>>
1624 _GetPropertyStackWithLayerOffsets(
1625 const UsdProperty &prop, UsdTimeCode time) const;
1626
1627 static SdfPrimSpecHandleVector
1628 _GetPrimStack(const UsdPrim &prim);
1629
1630 static std::vector<std::pair<SdfPrimSpecHandle, SdfLayerOffset>>
1631 _GetPrimStackWithLayerOffsets(const UsdPrim &prim);
1632
1634 _GetSchemaProperty(const UsdProperty &prop) const;
1635
1637 _GetSchemaAttribute(const UsdAttribute &attr) const;
1638
1640 _GetSchemaRelationship(const UsdRelationship &rel) const;
1641
1642 SdfAttributeSpecHandle
1643 _CreateNewSpecFromSchemaAttribute(
1644 const UsdPrim &prim,
1645 const UsdPrimDefinition::Attribute &attrDef);
1646
1647 SdfRelationshipSpecHandle
1648 _CreateNewSpecFromSchemaRelationship(
1649 const UsdPrim &prim,
1650 const UsdPrimDefinition::Relationship &relDef);
1651
1652 template <class PropType>
1654 _CreateNewPropertySpecFromSchema(const UsdProperty &prop);
1655
1656 SdfPrimSpecHandle
1657 _CreatePrimSpecForEditing(const UsdPrim& prim);
1658
1659 template <class PropType>
1661 _CreatePropertySpecForEditing(const UsdProperty &prop);
1662
1663 SdfPropertySpecHandle
1664 _CreatePropertySpecForEditing(const UsdProperty &prop);
1665
1666 SdfAttributeSpecHandle
1667 _CreateAttributeSpecForEditing(const UsdAttribute &attr);
1668
1669 SdfRelationshipSpecHandle
1670 _CreateRelationshipSpecForEditing(const UsdRelationship &rel);
1671
1672 // Check if the given path is valid to use with the prim creation API,
1673 // like DefinePrim. If it is valid, returns (true, GetPrimAtPath(path)).
1674 // Otherwise, returns (false, UsdPrim()).
1675 std::pair<bool, UsdPrim>
1676 _IsValidPathForCreatingPrim(const SdfPath &path) const;
1677
1678 // Validates that editing a specified prim is allowed. If editing is not
1679 // allowed, issues a coding error like "Cannot <operation> ..." and
1680 // returns false. Otherwise, returns true.
1681 bool _ValidateEditPrim(const UsdPrim &prim, const char* operation) const;
1682 bool _ValidateEditPrimAtPath(const SdfPath &primPath,
1683 const char* operation) const;
1684
1685 UsdPrim _DefinePrim(const SdfPath &path, const TfToken &typeName);
1686
1687 bool _RemoveProperty(const SdfPath& path);
1688
1689 UsdProperty _FlattenProperty(const UsdProperty &srcProp,
1690 const UsdPrim &dstParent,
1691 const TfToken &dstName);
1692
1693 // --------------------------------------------------------------------- //
1694 // Value & Metadata Authoring
1695 // --------------------------------------------------------------------- //
1696
1697 // Trait that allows us to call the correct versions of _SetValue and
1698 // _SetMetadata for types whose values need to be mapped when written to
1699 // different edit targets.
1700 template <class T>
1701 struct _IsEditTargetMappable {
1702 static const bool value =
1703 std::is_same<T, SdfTimeCode>::value ||
1704 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1705 std::is_same<T, SdfPathExpression>::value ||
1706 std::is_same<T, VtArray<SdfPathExpression>>::value ||
1707 std::is_same<T, SdfTimeSampleMap>::value ||
1708 std::is_same<T, TsSpline>::value ||
1709 std::is_same<T, VtDictionary>::value;
1710 };
1711
1712 // Set value for types that don't need to be mapped for edit targets.
1713 template <class T>
1714 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1715 _SetValue(
1716 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1717
1718 // Set value for types that do need to be mapped for edit targets.
1719 template <class T>
1720 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1721 _SetValue(
1722 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1723
1724 // Set value for dynamically typed VtValue. Will map the value across edit
1725 // targets if the held value type supports it.
1726 bool _SetValue(
1727 UsdTimeCode time, const UsdAttribute &attr, const VtValue &newValue);
1728
1729 template <class T>
1730 bool _SetEditTargetMappedValue(
1731 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1732
1733 TfType _GetAttributeValueType(
1734 const UsdAttribute &attr) const;
1735
1736 template <class T>
1737 bool _SetValueImpl(
1738 UsdTimeCode time, const UsdAttribute &attr, const T& value);
1739
1740 bool _ClearValue(UsdTimeCode time, const UsdAttribute &attr);
1741
1742 // Set metadata for types that don't need to be mapped across edit targets.
1743 template <class T>
1744 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1745 _SetMetadata(const UsdObject &object, const TfToken& key,
1746 const TfToken &keyPath, const T& value);
1747
1748 // Set metadata for types that do need to be mapped for edit targets.
1749 template <class T>
1750 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1751 _SetMetadata(const UsdObject &object, const TfToken& key,
1752 const TfToken &keyPath, const T& value);
1753
1754 // Set metadata for dynamically typed VtValue. Will map the value across
1755 // edit targets if the held value type supports it.
1756 USD_API
1757 bool _SetMetadata(const UsdObject &object,
1758 const TfToken& key,
1759 const TfToken &keyPath,
1760 const VtValue& value);
1761
1762 template <class T>
1763 bool _SetEditTargetMappedMetadata(
1764 const UsdObject &obj, const TfToken& fieldName,
1765 const TfToken &keyPath, const T &newValue);
1766
1767 template <class T>
1768 bool _SetMetadataImpl(
1769 const UsdObject &obj, const TfToken& fieldName,
1770 const TfToken &keyPath, const T &value);
1771
1772 bool _ClearMetadata(const UsdObject &obj, const TfToken& fieldName,
1773 const TfToken &keyPath=TfToken());
1774
1775 // --------------------------------------------------------------------- //
1776 // Misc Internal Helpers
1777 // --------------------------------------------------------------------- //
1778
1779 // Pcp helpers.
1780 PcpCache const *_GetPcpCache() const { return _cache.get(); }
1781 PcpCache *_GetPcpCache() { return _cache.get(); }
1782
1783 // Returns the PrimIndex, using the read-only PcpCache API. We expect prims
1784 // to be composed during initial stage composition, so this method should
1785 // not be used in that context.
1786 const PcpPrimIndex* _GetPcpPrimIndex(const SdfPath& primPath) const;
1787
1788 // Helper to report pcp errors.
1789 void _ReportPcpErrors(const PcpErrorVector &errors,
1790 const std::string &context) const;
1791 void _ReportErrors(const PcpErrorVector &errors,
1792 const std::vector<std::string>& otherErrors,
1793 const std::string &context) const;
1794
1795 // --------------------------------------------------------------------- //
1796 // Scenegraph Composition & Change Processing
1797 // --------------------------------------------------------------------- //
1798
1799 // Compose the prim indexes in the subtrees rooted at the paths in
1800 // \p primIndexPaths. If \p instanceChanges is given, returns
1801 // changes to prototypes and instances due to the discovery of new instances
1802 // during composition.
1803 void _ComposePrimIndexesInParallel(
1804 const std::vector<SdfPath>& primIndexPaths,
1805 const std::string& context,
1806 Usd_InstanceChanges* instanceChanges = nullptr);
1807
1808 // Recompose the subtree rooted at \p prim: compose its type, flags, and
1809 // list of children, then invoke _ComposeSubtree on all its children.
1810 void _ComposeSubtree(
1811 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1812 UsdStagePopulationMask const *mask,
1813 const SdfPath &primIndexPath = SdfPath());
1814 void _ComposeSubtreeImpl(
1815 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1816 UsdStagePopulationMask const *mask,
1817 const SdfPath &primIndexPath = SdfPath());
1818 void _ComposeSubtreesInParallel(
1819 const std::vector<Usd_PrimDataPtr> &prims,
1820 const std::vector<SdfPath> *primIndexPaths = nullptr);
1821
1822 // Composes the full prim type info for the prim based on its type name
1823 // and applied API schemas.
1824 void _ComposePrimTypeInfoImpl(Usd_PrimDataPtr prim);
1825
1826 // Compose subtree rooted at \p prim under \p parent. This function
1827 // ensures that the appropriate prim index is specified for \p prim if
1828 // \p parent is in a prototype.
1829 void _ComposeChildSubtree(Usd_PrimDataPtr prim,
1830 Usd_PrimDataConstPtr parent,
1831 UsdStagePopulationMask const *mask);
1832
1833 // Compose \p prim's list of children and make any modifications necessary
1834 // to its _children member and the stage's _primMap, including possibly
1835 // instantiating new prims, or destroying existing subtrees of prims. The
1836 // any newly created prims *do not* have their prim index, type, flags, or
1837 // children composed.
1838 //
1839 // Compose only \p prim's direct children if recurse=false. Otherwise
1840 // recompose every descendent of \p prim. Callers that pass recurse=false
1841 // should invoke _ComposeSubtree on any newly created prims to ensure caches
1842 // are correctly populated.
1843 void _ComposeChildren(Usd_PrimDataPtr prim,
1844 UsdStagePopulationMask const *mask, bool recurse);
1845
1846 // Instantiate a prim instance. There must not already be an instance
1847 // at \p primPath.
1848 Usd_PrimDataPtr _InstantiatePrim(const SdfPath &primPath);
1849
1850 // Instantiate a prototype prim and sets its parent to pseudoroot.
1851 // There must not already be a prototype at \p primPath.
1852 Usd_PrimDataPtr _InstantiatePrototypePrim(const SdfPath &primPath);
1853
1854 // For \p prim and all of its descendants, remove from _primMap and empty
1855 // their _children vectors.
1856 void _DestroyPrim(Usd_PrimDataPtr prim);
1857
1858 // Destroy the prim subtrees rooted at each path in \p paths. \p paths may
1859 // not contain any path that is a descendent of another path in \p paths.
1860 void _DestroyPrimsInParallel(const std::vector<SdfPath>& paths);
1861
1862 // Invoke _DestroyPrim() on all of \p prim's direct children.
1863 void _DestroyDescendents(Usd_PrimDataPtr prim);
1864
1865 // Returns true if the object at the given path is a descendant of
1866 // an instance prim, i.e. a prim beneath an instance prim, or a property
1867 // of a prim beneath an instance prim.
1868 bool _IsObjectDescendantOfInstance(const SdfPath& path) const;
1869
1870 // If the given prim is an instance, returns the corresponding
1871 // prototype prim. Otherwise, returns an invalid prim.
1872 Usd_PrimDataConstPtr _GetPrototypeForInstance(Usd_PrimDataConstPtr p) const;
1873
1874 // Returns the path of the Usd prim using the prim index at the given path.
1875 SdfPath _GetPrimPathUsingPrimIndexAtPath(const SdfPath& primIndexPath) const;
1876
1877 // Responds to LayersDidChangeSentPerLayer event and update stage contents
1878 // in response to changes in scene description.
1879 void _HandleLayersDidChange(const SdfNotice::LayersDidChangeSentPerLayer &);
1880
1881 // Pushes changes through PCP to determine invalidation based on
1882 // composition metadata.
1883 void _ProcessChangeLists(const SdfLayerChangeListVec &);
1884
1885 // Update stage contents in response to changes to the asset resolver.
1886 void _HandleResolverDidChange(const ArNotice::ResolverChanged &);
1887
1888 // Process stage change information stored in _pendingChanges.
1889 // _pendingChanges will be set to nullptr by the end of the function.
1890 void _ProcessPendingChanges();
1891
1892 // Remove scene description for the prim at \p fullPath in the current edit
1893 // target.
1894 bool _RemovePrim(const SdfPath& fullPath);
1895
1896 SdfPrimSpecHandle _GetPrimSpec(const SdfPath& fullPath);
1897
1898 // Find and return the defining spec type for the property spec at the given
1899 // path, or SdfSpecTypeUnknown if none exists. The defining spec type is
1900 // either the builtin definition's spec type, if the indicated property is
1901 // builtin, otherwise it's the strongest authored spec's type if one exists,
1902 // otherwise it's SdfSpecTypeUnknown.
1903 SdfSpecType _GetDefiningSpecType(Usd_PrimDataConstPtr primData,
1904 const TfToken &propName) const;
1905
1906 // Helper to apply Pcp changes and recompose the scenegraph accordingly,
1907 // given an optional initial set of paths to recompose.
1908 void _Recompose(const PcpChanges &changes);
1909 template <class T>
1910 void _Recompose(const PcpChanges &changes, T *pathsToRecompose);
1911 template <class T>
1912 void _RecomposePrims(T *pathsToRecompose);
1913
1914 // Helper for _Recompose to find the subtrees that need to be
1915 // fully recomposed and to recompose the name children of the
1916 // parents of these subtrees. Note that [start, finish) must be a
1917 // sorted range of map iterators whose keys are paths with no descendent
1918 // paths. In C++20, consider using the ranges API to improve this.
1919 template <class Iter>
1920 void _ComputeSubtreesToRecompose(Iter start, Iter finish,
1921 std::vector<Usd_PrimDataPtr>* recompose);
1922
1923 // return true if the path is valid for load/unload operations.
1924 // This method will emit errors when invalid paths are encountered.
1925 bool _IsValidForLoad(const SdfPath& path) const;
1926 bool _IsValidForUnload(const SdfPath& path) const;
1927
1928 // Discover all payloads in a given subtree, adding the path of each
1929 // discovered prim index to the \p primIndexPaths set. If specified,
1930 // the corresponding UsdPrim path will be added to the \p usdPrimPaths
1931 // set. The root path will be considered for inclusion in the result set.
1932 //
1933 // Note that some payloads may not be discoverable in until an ancestral
1934 // payload has been included. UsdStage::LoadAndUnload takes this into
1935 // account.
1936 void _DiscoverPayloads(const SdfPath& rootPath,
1937 UsdLoadPolicy policy,
1938 SdfPathSet* primIndexPaths,
1939 bool unloadedOnly = false,
1940 SdfPathSet* usdPrimPaths = nullptr) const;
1941
1942 // ===================================================================== //
1943 // VALUE RESOLUTION //
1944 // ===================================================================== //
1945 // --------------------------------------------------------------------- //
1946 // Specialized Value Resolution
1947 // --------------------------------------------------------------------- //
1948
1949 // Helpers for resolving values for metadata fields requiring
1950 // special behaviors.
1951 static SdfSpecifier _GetSpecifier(Usd_PrimDataConstPtr primData);
1952 static TfToken _GetKind(Usd_PrimDataConstPtr primData);
1953 static bool _IsActive(Usd_PrimDataConstPtr primData);
1954
1955 // Custom is true if it is true anywhere in the stack.
1956 bool _IsCustom(const UsdProperty &prop) const;
1957
1958 // Variability is determined by the weakest opinion in the stack.
1959 SdfVariability _GetVariability(const UsdProperty &prop) const;
1960
1961 // Helper functions for resolving asset paths during value resolution.
1962 void _MakeResolvedAssetPaths(UsdTimeCode time, const UsdAttribute &attr,
1963 SdfAssetPath *assetPaths,
1964 size_t numAssetPaths,
1965 bool anchorAssetPathsOnly = false) const;
1966
1967 void _MakeResolvedAssetPathsValue(UsdTimeCode time, const UsdAttribute &attr,
1968 VtValue *value,
1969 bool anchorAssetPathsOnly = false) const;
1970
1971 void _MakeResolvedTimeCodes(UsdTimeCode time, const UsdAttribute &attr,
1972 SdfTimeCode *timeCodes,
1973 size_t numTimeCodes) const;
1974
1975 void _MakeResolvedPathExpressions(
1976 UsdTimeCode time, const UsdAttribute &attr,
1977 SdfPathExpression *pathExprs,
1978 size_t numPathExprs) const;
1979
1980 void _MakeResolvedAttributeValue(UsdTimeCode time, const UsdAttribute &attr,
1981 VtValue *value) const;
1982
1983 // --------------------------------------------------------------------- //
1984 // Metadata Resolution
1985 // --------------------------------------------------------------------- //
1986
1987public:
1988 // Trait that allows us to call the correct version of _GetMetadata for
1989 // types that require type specific value resolution as opposed to just
1990 // strongest opinion. These types also use type specific resolution
1991 // in _GetValue.
1992 template <class T>
1993 struct _HasTypeSpecificResolution {
1994 static const bool value =
1995 std::is_same<T, SdfAssetPath>::value ||
1996 std::is_same<T, VtArray<SdfAssetPath>>::value ||
1997 std::is_same<T, SdfTimeCode>::value ||
1998 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1999 std::is_same<T, SdfPathExpression>::value ||
2000 std::is_same<T, VtArray<SdfPathExpression>>::value ||
2001 std::is_same<T, SdfTimeSampleMap>::value ||
2002 std::is_same<T, TsSpline>::value ||
2003 std::is_same<T, VtDictionary>::value;
2004 };
2005
2006private:
2007 // Get metadata for types that do not have type specific value resolution.
2008 template <class T>
2009 typename std::enable_if<!_HasTypeSpecificResolution<T>::value, bool>::type
2010 _GetMetadata(const UsdObject &obj,
2011 const TfToken& fieldName,
2012 const TfToken &keyPath,
2013 bool useFallbacks,
2014 T* result) const;
2015
2016 // Get metadata for types that do have type specific value resolution.
2017 template <class T>
2018 typename std::enable_if<_HasTypeSpecificResolution<T>::value, bool>::type
2019 _GetMetadata(const UsdObject &obj,
2020 const TfToken& fieldName,
2021 const TfToken &keyPath,
2022 bool useFallbacks,
2023 T* result) const;
2024
2025 // Get metadata as a dynamically typed VtValue. Will perform type specific
2026 // value resolution if the returned held type requires it.
2027 bool _GetMetadata(const UsdObject &obj,
2028 const TfToken& fieldName,
2029 const TfToken &keyPath,
2030 bool useFallbacks,
2031 VtValue* result) const;
2032
2033 // Gets a metadata value using only strongest value resolution. It is
2034 // assumed that result is holding a value that does not require type
2035 // specific value resolution.
2036 USD_API
2037 bool _GetStrongestResolvedMetadata(const UsdObject &obj,
2038 const TfToken& fieldName,
2039 const TfToken &keyPath,
2040 bool useFallbacks,
2041 SdfAbstractDataValue* result) const;
2042
2043 // Gets a metadata value with the type specific value resolution for the
2044 // type applied. This is only implemented for types that
2045 // _HasTypeSpecificResolution.
2046 template <class T>
2047 USD_API
2048 bool _GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2049 const TfToken& fieldName,
2050 const TfToken &keyPath,
2051 bool useFallbacks,
2052 T* result) const;
2053
2054 template <class Composer>
2055 void _GetAttrTypeImpl(const UsdAttribute &attr,
2056 const TfToken &fieldName,
2057 bool useFallbacks,
2058 Composer *composer) const;
2059
2060 template <class Composer>
2061 void _GetAttrVariabilityImpl(const UsdAttribute &attr,
2062 bool useFallbacks,
2063 Composer *composer) const;
2064
2065 template <class Composer>
2066 void _GetPropCustomImpl(const UsdProperty &prop,
2067 bool useFallbacks,
2068 Composer *composer) const;
2069
2070 template <class Composer>
2071 bool _GetSpecialPropMetadataImpl(const UsdObject &obj,
2072 const TfToken &fieldName,
2073 const TfToken &keyPath,
2074 bool useFallbacks,
2075 Composer *composer) const;
2076 template <class Composer>
2077 bool _GetMetadataImpl(const UsdObject &obj,
2078 const TfToken& fieldName,
2079 const TfToken& keyPath,
2080 bool includeFallbacks,
2081 Composer *composer) const;
2082
2083 template <class Composer>
2084 bool _GetGeneralMetadataImpl(const UsdObject &obj,
2085 const TfToken& fieldName,
2086 const TfToken& keyPath,
2087 bool includeFallbacks,
2088 Composer *composer) const;
2089
2090 // NOTE: The "authoredOnly" flag is not yet in use, but when we have
2091 // support for prim-based metadata fallbacks, they should be ignored when
2092 // this flag is set to true.
2093 bool _HasMetadata(const UsdObject &obj, const TfToken& fieldName,
2094 const TfToken &keyPath, bool useFallbacks) const;
2095
2097 _ListMetadataFields(const UsdObject &obj, bool useFallbacks) const;
2098
2099 void _GetAllMetadata(const UsdObject &obj,
2100 bool useFallbacks,
2101 UsdMetadataValueMap* result,
2102 bool anchorAssetPathsOnly = false) const;
2103
2104 // --------------------------------------------------------------------- //
2105 // Default & TimeSample Resolution
2106 // --------------------------------------------------------------------- //
2107
2108 void _GetResolveInfo(const UsdAttribute &attr,
2109 UsdResolveInfo *resolveInfo,
2110 const UsdTimeCode *time = nullptr) const;
2111
2112 void _GetResolveInfoWithResolveTarget(
2113 const UsdAttribute &attr,
2114 const UsdResolveTarget &resolveTarget,
2115 UsdResolveInfo *resolveInfo,
2116 const UsdTimeCode *time = nullptr) const;
2117
2118 template <class T> struct _ExtraResolveInfo;
2119
2120 // Gets the value resolve info for the given attribute. If time is provided,
2121 // the resolve info is evaluated for that specific time (which may be
2122 // default). Otherwise, if time is null, the resolve info is evaluated for
2123 // "any numeric time" and will not populate values in extraInfo that
2124 // require a specific time to be evaluated.
2125 template <class T>
2126 void _GetResolveInfo(const UsdAttribute &attr,
2127 UsdResolveInfo *resolveInfo,
2128 const UsdTimeCode *time = nullptr,
2129 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2130
2131 // Gets the value resolve info for the given attribute using the given
2132 // resolve target. If time is provided, the resolve info is evaluated for
2133 // that specific time (which may be default). Otherwise, if time is null,
2134 // the resolve info is evaluated for "any numeric time" and will not
2135 // populate values in extraInfo that require a specific time to be
2136 // evaluated.
2137 template <class T>
2138 void _GetResolveInfoWithResolveTarget(
2139 const UsdAttribute &attr,
2140 const UsdResolveTarget &resolveTarget,
2141 UsdResolveInfo *resolveInfo,
2142 const UsdTimeCode *time = nullptr,
2143 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2144
2145 // Shared implementation function for _GetResolveInfo and
2146 // _GetResolveInfoWithResolveTarget. The only difference between how these
2147 // two functions behave is in how they create the Usd_Resolver used for
2148 // iterating over nodes and layers, thus they provide this implementation
2149 // with the needed MakeUsdResolverFn to create the Usd_Resolver.
2150 template <class T, class MakeUsdResolverFn>
2151 void _GetResolveInfoImpl(const UsdAttribute &attr,
2152 UsdResolveInfo *resolveInfo,
2153 const UsdTimeCode *time,
2154 _ExtraResolveInfo<T> *extraInfo,
2155 const MakeUsdResolverFn &makeUsdResolveFn) const;
2156
2157 template <class T> struct _ResolveInfoResolver;
2158 struct _PropertyStackResolver;
2159
2160 template <class Resolver, class MakeUsdResolverFn>
2161 void _GetResolvedValueAtDefaultImpl(
2162 const UsdProperty &prop,
2163 Resolver *resolver,
2164 const MakeUsdResolverFn &makeUsdResolverFn) const;
2165
2166 template <class Resolver, class MakeUsdResolverFn>
2167 void _GetResolvedValueAtTimeImpl(
2168 const UsdProperty &prop,
2169 Resolver *resolver,
2170 const double *time,
2171 const MakeUsdResolverFn &makeUsdResolverFn) const;
2172
2173 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2174 VtValue* result) const;
2175
2176 template <class T>
2177 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2178 T* result) const;
2179
2180 template <class T>
2181 bool _GetValueImpl(UsdTimeCode time, const UsdAttribute &attr,
2182 Usd_InterpolatorBase* interpolator,
2183 T* value) const;
2184
2185 USD_API
2186 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2187 UsdTimeCode time, const UsdAttribute &attr,
2188 VtValue* result) const;
2189
2190 template <class T>
2191 USD_API
2192 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2193 UsdTimeCode time, const UsdAttribute &attr,
2194 T* result) const;
2195
2196 template <class T>
2197 bool _GetValueFromResolveInfoImpl(const UsdResolveInfo &info,
2198 UsdTimeCode time, const UsdAttribute &attr,
2199 Usd_InterpolatorBase* interpolator,
2200 T* value) const;
2201
2202 template <class T>
2203 bool _GetDefaultValueFromResolveInfoImpl(const UsdResolveInfo &info,
2204 const UsdAttribute &attr,
2205 T* value) const;
2206
2207 Usd_AssetPathContext
2208 _GetAssetPathContext(UsdTimeCode time, const UsdAttribute &attr) const;
2209
2210 // --------------------------------------------------------------------- //
2211 // Specialized Time Sample I/O
2212 // --------------------------------------------------------------------- //
2213
2220 bool _GetTimeSamplesInInterval(const UsdAttribute &attr,
2221 const GfInterval& interval,
2222 std::vector<double>* times) const;
2223
2224 bool _GetTimeSamplesInIntervalFromResolveInfo(
2225 const UsdResolveInfo &info,
2226 const UsdAttribute &attr,
2227 const GfInterval& interval,
2228 std::vector<double>* times) const;
2229
2230 size_t _GetNumTimeSamples(const UsdAttribute &attr) const;
2231
2232 size_t _GetNumTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2233 const UsdAttribute &attr) const;
2234
2238 bool _GetBracketingTimeSamples(const UsdAttribute &attr,
2239 double desiredTime,
2240 bool authoredOnly,
2241 double* lower,
2242 double* upper,
2243 bool* hasSamples) const;
2244
2245 bool _GetBracketingTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2246 const UsdAttribute &attr,
2247 double desiredTime,
2248 bool authoredOnly,
2249 double* lower,
2250 double* upper,
2251 bool* hasSamples) const;
2252
2253 bool _ValueMightBeTimeVarying(const UsdAttribute &attr) const;
2254
2255 bool _ValueMightBeTimeVaryingFromResolveInfo(const UsdResolveInfo &info,
2256 const UsdAttribute &attr) const;
2257
2258 void _RegisterPerLayerNotices();
2259 void _RegisterResolverChangeNotice();
2260
2261 // Helper to obtain a malloc tag string for this stage.
2262 inline char const *_GetMallocTagId() const;
2263
2264private:
2265
2266 // The 'pseudo root' prim.
2267 Usd_PrimDataPtr _pseudoRoot;
2268
2269 // The stage's root layer.
2270 SdfLayerRefPtr _rootLayer;
2271
2272 // Every UsdStage has an implicit, in-memory session layer.
2273 // This is to allow for runtime overrides such as variant selections.
2274 SdfLayerRefPtr _sessionLayer;
2275
2276 // The stage's EditTarget.
2277 UsdEditTarget _editTarget;
2278 bool _editTargetIsLocalLayer;
2279
2280 std::unique_ptr<PcpCache> _cache;
2281 std::unique_ptr<Usd_ClipCache> _clipCache;
2282 std::unique_ptr<Usd_InstanceCache> _instanceCache;
2283
2284 TfHashMap<TfToken, TfToken, TfHash> _invalidPrimTypeToFallbackMap;
2285
2286 size_t _usedLayersRevision;
2287
2288 // A concurrent map from Path to Prim, for fast random access.
2289 struct _TbbHashEq {
2290 inline bool equal(SdfPath const &l, SdfPath const &r) const {
2291 return l == r;
2292 }
2293 inline size_t hash(SdfPath const &path) const {
2294 return path.GetHash();
2295 }
2296 };
2297 using PathToNodeMap = tbb::concurrent_hash_map<
2298 SdfPath, Usd_PrimDataIPtr, _TbbHashEq>;
2299 PathToNodeMap _primMap;
2300
2301 // The interpolation type used for all attributes on the stage.
2302 UsdInterpolationType _interpolationType;
2303
2304 typedef std::vector<
2305 std::pair<SdfLayerHandle, TfNotice::Key> > _LayerAndNoticeKeyVec;
2306 _LayerAndNoticeKeyVec _layersAndNoticeKeys;
2307 size_t _lastChangeSerialNumber;
2308
2309 TfNotice::Key _resolverChangeKey;
2310
2311 // Data for pending change processing.
2312 class _PendingChanges;
2313 _PendingChanges* _pendingChanges;
2314
2315 std::optional<WorkDispatcher> _dispatcher;
2316
2317 // To provide useful aggregation of malloc stats, we bill everything
2318 // for this stage - from all access points - to this tag.
2319 std::unique_ptr<std::string> _mallocTagID;
2320
2321 // The state used when instantiating the stage.
2322 const InitialLoadSet _initialLoadSet;
2323
2324 // The population mask that applies to this stage.
2325 UsdStagePopulationMask _populationMask;
2326
2327 // The load rules that apply to this stage.
2328 UsdStageLoadRules _loadRules;
2329
2330 bool _isClosingStage;
2331 bool _isWritingFallbackPrimTypes;
2332
2333 friend class UsdAPISchemaBase;
2334 friend class UsdAttribute;
2335 friend class UsdAttributeQuery;
2336 friend class UsdEditTarget;
2337 friend class UsdInherits;
2338 friend class UsdNamespaceEditor;
2339 friend class UsdObject;
2340 friend class UsdPrim;
2341 friend class UsdProperty;
2342 friend class UsdRelationship;
2343 friend class UsdSpecializes;
2344 friend class UsdVariantSet;
2345 friend class UsdVariantSets;
2346 friend class Usd_AssetPathContext;
2347 friend class Usd_FlattenAccess;
2348 friend class Usd_PcpCacheAccess;
2349 friend class Usd_PrimData;
2350 friend class Usd_StageOpenRequest;
2351 friend class Usd_TypeQueryAccess;
2352 template <class T> friend struct Usd_AttrGetValueHelper;
2353 friend struct Usd_AttrGetUntypedValueHelper;
2354 template <class RefsOrPayloadsEditorType, class RefsOrPayloadsProxyType>
2355 friend struct Usd_ListEditImpl;
2356};
2357
2358// UsdObject's typed metadata query relies on this specialization being
2359// externally visible and exporting the primary template does not
2360// automatically export this specialization.
2361template <>
2362USD_API
2363bool
2364UsdStage::_GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2365 const TfToken& fieldName,
2366 const TfToken &keyPath,
2367 bool useFallbacks,
2368 SdfTimeSampleMap* result) const;
2369
2370template<typename T>
2371bool
2372UsdStage::GetMetadata(const TfToken& key, T* value) const
2373{
2374 VtValue result;
2375 if (!GetMetadata(key, &result)){
2376 return false;
2377 }
2378
2379 if (result.IsHolding<T>()){
2380 *value = result.UncheckedGet<T>();
2381 return true;
2382 } else {
2383 TF_CODING_ERROR("Requested type %s for stage metadatum %s does not"
2384 " match retrieved type %s",
2385 ArchGetDemangled<T>().c_str(),
2386 key.GetText(),
2387 result.GetTypeName().c_str());
2388 return false;
2389 }
2390}
2391
2392template<typename T>
2393bool
2394UsdStage::SetMetadata(const TfToken& key, const T& value) const
2395{
2396 VtValue in(value);
2397 return SetMetadata(key, in);
2398}
2399
2400template<typename T>
2401bool
2403 T* value) const
2404{
2405 VtValue result;
2406 if (!GetMetadataByDictKey(key, keyPath, &result)){
2407 return false;
2408 }
2409
2410 if (result.IsHolding<T>()){
2411 *value = result.UncheckedGet<T>();
2412 return true;
2413 } else {
2414 TF_CODING_ERROR("Requested type %s for stage metadatum %s[%s] does not"
2415 " match retrieved type %s",
2416 ArchGetDemangled<T>().c_str(),
2417 key.GetText(),
2418 keyPath.GetText(),
2419 result.GetTypeName().c_str());
2420 return false;
2421 }
2422}
2423
2424template<typename T>
2425bool
2427 const T& value) const
2428{
2429 VtValue in(value);
2430 return SetMetadataByDictKey(key, keyPath, in);
2431}
2432
2433// Get metadata for types that do not have type specific value resolution.
2434template <class T>
2435typename std::enable_if<
2436 !UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2437UsdStage::_GetMetadata(const UsdObject &obj,
2438 const TfToken& fieldName,
2439 const TfToken &keyPath,
2440 bool useFallbacks,
2441 T* result) const
2442{
2443 // Since these types don't have type specific value resolution, we can just
2444 // get the strongest metadata value and be done.
2445 SdfAbstractDataTypedValue<T> out(result);
2446 return _GetStrongestResolvedMetadata(
2447 obj, fieldName, keyPath, useFallbacks, &out);
2448}
2449
2450// Get metadata for types that do have type specific value resolution.
2451template <class T>
2452typename std::enable_if<
2453 UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2454UsdStage::_GetMetadata(const UsdObject &obj,
2455 const TfToken& fieldName,
2456 const TfToken &keyPath,
2457 bool useFallbacks,
2458 T* result) const
2459{
2460 // Call the templated type specifice resolved metadata implementation that
2461 // will only be implemented for types that support it.
2462 return _GetTypeSpecificResolvedMetadata(
2463 obj, fieldName, keyPath, useFallbacks, result);
2464}
2465
2466
2467// Set metadata for types that don't need to be mapped across edit targets.
2468template <class T>
2469typename std::enable_if<!UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2470UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2471 const TfToken &keyPath, const T& value)
2472{
2473 // Since we know that we don't need to map the value for edit targets,
2474 // we can just type erase the value and set the metadata as is.
2476 return _SetMetadataImpl<SdfAbstractDataConstValue>(
2477 object, key, keyPath, in);
2478}
2479
2480// Set metadata for types that do need to be mapped for 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 return _SetEditTargetMappedMetadata(object, key, keyPath, value);
2487}
2488
2489PXR_NAMESPACE_CLOSE_SCOPE
2490
2491#endif //PXR_USD_USD_STAGE_H
2492
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:198
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
Definition: primIndex.h:62
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:554
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:458
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:84
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
Definition: layer.h:107
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:240
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
TfType represents a dynamic runtime type.
Definition: type.h:48
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:124
A mathematical description of a curved function from time to value.
Definition: spline.h:59
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:160
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:64
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:136
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:2394
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:655
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:150
@ LoadAll
Load all loadable prims.
Definition: stage.h:151
@ LoadNone
Load no loadable prims.
Definition: stage.h:152
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:2426
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 for querying color configuration metadata stored in a...
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:2402
USD_API SdfAssetPath GetColorConfiguration() const
Returns the default color configuration stored in layer metadata.
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:2372
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:638
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