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 // --------------------------------------------------------------------- //
1509 // --------------------------------------------------------------------- //
1510
1516 USD_API
1517 void SetColorConfiguration(const SdfAssetPath &colorConfig) const;
1518
1523 USD_API
1525
1530 USD_API
1531 void SetColorManagementSystem(const TfToken &cms) const;
1532
1537 USD_API
1539
1551 USD_API
1552 static void GetColorConfigFallbacks(SdfAssetPath *colorConfiguration,
1553 TfToken *colorManagementSystem);
1554
1568 USD_API
1569 static void
1570 SetColorConfigFallbacks(const SdfAssetPath &colorConfiguration,
1571 const TfToken &colorManagementSystem);
1572
1574
1575 // --------------------------------------------------------------------- //
1582 // --------------------------------------------------------------------- //
1583
1588 USD_API
1590
1593 USD_API
1595
1597
1598 // --------------------------------------------------------------------- //
1603 // --------------------------------------------------------------------- //
1604
1606 USD_API
1607 std::vector<UsdPrim> GetPrototypes() const;
1608
1610
1611private:
1612 struct _IncludePayloadsPredicate;
1613
1614 // --------------------------------------------------------------------- //
1615 // Stage Construction & Initialization
1616 // --------------------------------------------------------------------- //
1617
1618 UsdStage(const SdfLayerRefPtr& rootLayer,
1619 const SdfLayerRefPtr& sessionLayer,
1620 const ArResolverContext& pathResolverContext,
1621 const UsdStagePopulationMask& mask,
1622 InitialLoadSet load);
1623
1624 // Helper for Open() overloads -- searches and publishes to bound caches.
1625 template <class... Args>
1626 static UsdStageRefPtr _OpenImpl(InitialLoadSet load, Args const &... args);
1627
1628 // Releases resources used by this stage.
1629 void _Close();
1630
1631 // Common ref ptr initialization, called by public, static constructors.
1632 //
1633 // This method will either return a valid refptr (if the stage is correctly
1634 // initialized) or it will return a null ref pointer, deleting the
1635 // raw stage pointer in the process.
1636 static UsdStageRefPtr
1637 _InstantiateStage(const SdfLayerRefPtr &rootLayer,
1638 const SdfLayerRefPtr &sessionLayer,
1639 const ArResolverContext &pathResolverContext,
1640 const UsdStagePopulationMask &mask,
1641 InitialLoadSet load);
1642
1643 // --------------------------------------------------------------------- //
1644 // Spec Existence & Definition Helpers
1645 // --------------------------------------------------------------------- //
1646
1647 SdfPropertySpecHandleVector
1648 _GetPropertyStack(const UsdProperty &prop, UsdTimeCode time) const;
1649
1650 std::vector<std::pair<SdfPropertySpecHandle, SdfLayerOffset>>
1651 _GetPropertyStackWithLayerOffsets(
1652 const UsdProperty &prop, UsdTimeCode time) const;
1653
1654 static SdfPrimSpecHandleVector
1655 _GetPrimStack(const UsdPrim &prim);
1656
1657 static std::vector<std::pair<SdfPrimSpecHandle, SdfLayerOffset>>
1658 _GetPrimStackWithLayerOffsets(const UsdPrim &prim);
1659
1661 _GetSchemaProperty(const UsdProperty &prop) const;
1662
1664 _GetSchemaAttribute(const UsdAttribute &attr) const;
1665
1667 _GetSchemaRelationship(const UsdRelationship &rel) const;
1668
1669 SdfAttributeSpecHandle
1670 _CreateNewSpecFromSchemaAttribute(
1671 const UsdPrim &prim,
1672 const UsdPrimDefinition::Attribute &attrDef);
1673
1674 SdfRelationshipSpecHandle
1675 _CreateNewSpecFromSchemaRelationship(
1676 const UsdPrim &prim,
1677 const UsdPrimDefinition::Relationship &relDef);
1678
1679 template <class PropType>
1681 _CreateNewPropertySpecFromSchema(const UsdProperty &prop);
1682
1683 SdfPrimSpecHandle
1684 _CreatePrimSpecForEditing(const UsdPrim& prim);
1685
1686 template <class PropType>
1688 _CreatePropertySpecForEditing(const UsdProperty &prop);
1689
1690 SdfPropertySpecHandle
1691 _CreatePropertySpecForEditing(const UsdProperty &prop);
1692
1693 SdfAttributeSpecHandle
1694 _CreateAttributeSpecForEditing(const UsdAttribute &attr);
1695
1696 SdfRelationshipSpecHandle
1697 _CreateRelationshipSpecForEditing(const UsdRelationship &rel);
1698
1699 // Check if the given path is valid to use with the prim creation API,
1700 // like DefinePrim. If it is valid, returns (true, GetPrimAtPath(path)).
1701 // Otherwise, returns (false, UsdPrim()).
1702 std::pair<bool, UsdPrim>
1703 _IsValidPathForCreatingPrim(const SdfPath &path) const;
1704
1705 // Validates that editing a specified prim is allowed. If editing is not
1706 // allowed, issues a coding error like "Cannot <operation> ..." and
1707 // returns false. Otherwise, returns true.
1708 bool _ValidateEditPrim(const UsdPrim &prim, const char* operation) const;
1709 bool _ValidateEditPrimAtPath(const SdfPath &primPath,
1710 const char* operation) const;
1711
1712 UsdPrim _DefinePrim(const SdfPath &path, const TfToken &typeName);
1713
1714 bool _RemoveProperty(const SdfPath& path);
1715
1716 UsdProperty _FlattenProperty(const UsdProperty &srcProp,
1717 const UsdPrim &dstParent,
1718 const TfToken &dstName);
1719
1720 // --------------------------------------------------------------------- //
1721 // Value & Metadata Authoring
1722 // --------------------------------------------------------------------- //
1723
1724 // Trait that allows us to call the correct versions of _SetValue and
1725 // _SetMetadata for types whose values need to be mapped when written to
1726 // different edit targets.
1727 template <class T>
1728 struct _IsEditTargetMappable {
1729 static const bool value =
1730 std::is_same<T, SdfTimeCode>::value ||
1731 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1732 std::is_same<T, SdfPathExpression>::value ||
1733 std::is_same<T, VtArray<SdfPathExpression>>::value ||
1734 std::is_same<T, SdfTimeSampleMap>::value ||
1735 std::is_same<T, TsSpline>::value ||
1736 std::is_same<T, VtDictionary>::value;
1737 };
1738
1739 // Set value for types that don't need to be mapped for edit targets.
1740 template <class T>
1741 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1742 _SetValue(
1743 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1744
1745 // Set value for types that do need to be mapped for edit targets.
1746 template <class T>
1747 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1748 _SetValue(
1749 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1750
1751 // Set value for dynamically typed VtValue. Will map the value across edit
1752 // targets if the held value type supports it.
1753 bool _SetValue(
1754 UsdTimeCode time, const UsdAttribute &attr, const VtValue &newValue);
1755
1756 template <class T>
1757 bool _SetEditTargetMappedValue(
1758 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1759
1760 TfType _GetAttributeValueType(
1761 const UsdAttribute &attr) const;
1762
1763 template <class T>
1764 bool _SetValueImpl(
1765 UsdTimeCode time, const UsdAttribute &attr, const T& value);
1766
1767 bool _ClearValue(UsdTimeCode time, const UsdAttribute &attr);
1768
1769 // Set metadata for types that don't need to be mapped across 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 types that do need to be mapped for edit targets.
1776 template <class T>
1777 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1778 _SetMetadata(const UsdObject &object, const TfToken& key,
1779 const TfToken &keyPath, const T& value);
1780
1781 // Set metadata for dynamically typed VtValue. Will map the value across
1782 // edit targets if the held value type supports it.
1783 USD_API
1784 bool _SetMetadata(const UsdObject &object,
1785 const TfToken& key,
1786 const TfToken &keyPath,
1787 const VtValue& value);
1788
1789 template <class T>
1790 bool _SetEditTargetMappedMetadata(
1791 const UsdObject &obj, const TfToken& fieldName,
1792 const TfToken &keyPath, const T &newValue);
1793
1794 template <class T>
1795 bool _SetMetadataImpl(
1796 const UsdObject &obj, const TfToken& fieldName,
1797 const TfToken &keyPath, const T &value);
1798
1799 bool _ClearMetadata(const UsdObject &obj, const TfToken& fieldName,
1800 const TfToken &keyPath=TfToken());
1801
1802 // --------------------------------------------------------------------- //
1803 // Misc Internal Helpers
1804 // --------------------------------------------------------------------- //
1805
1806 // Pcp helpers.
1807 PcpCache const *_GetPcpCache() const { return _cache.get(); }
1808 PcpCache *_GetPcpCache() { return _cache.get(); }
1809
1810 // Returns the PrimIndex, using the read-only PcpCache API. We expect prims
1811 // to be composed during initial stage composition, so this method should
1812 // not be used in that context.
1813 const PcpPrimIndex* _GetPcpPrimIndex(const SdfPath& primPath) const;
1814
1815 // Helper to report pcp errors.
1816 void _ReportPcpErrors(const PcpErrorVector &errors,
1817 const std::string &context) const;
1818 void _ReportErrors(const PcpErrorVector &errors,
1819 const std::vector<std::string>& otherErrors,
1820 const std::string &context) const;
1821
1822 // --------------------------------------------------------------------- //
1823 // Scenegraph Composition & Change Processing
1824 // --------------------------------------------------------------------- //
1825
1826 // Compose the prim indexes in the subtrees rooted at the paths in
1827 // \p primIndexPaths. If \p instanceChanges is given, returns
1828 // changes to prototypes and instances due to the discovery of new instances
1829 // during composition.
1830 void _ComposePrimIndexesInParallel(
1831 const std::vector<SdfPath>& primIndexPaths,
1832 const std::string& context,
1833 Usd_InstanceChanges* instanceChanges = nullptr);
1834
1835 // Recompose the subtree rooted at \p prim: compose its type, flags, and
1836 // list of children, then invoke _ComposeSubtree on all its children.
1837 void _ComposeSubtree(
1838 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1839 UsdStagePopulationMask const *mask,
1840 const SdfPath &primIndexPath = SdfPath());
1841 void _ComposeSubtreeImpl(
1842 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1843 UsdStagePopulationMask const *mask,
1844 const SdfPath &primIndexPath = SdfPath());
1845 void _ComposeSubtreesInParallel(
1846 const std::vector<Usd_PrimDataPtr> &prims,
1847 const std::vector<SdfPath> *primIndexPaths = nullptr);
1848
1849 // Composes the full prim type info for the prim based on its type name
1850 // and applied API schemas.
1851 void _ComposePrimTypeInfoImpl(Usd_PrimDataPtr prim);
1852
1853 // Compose subtree rooted at \p prim under \p parent. This function
1854 // ensures that the appropriate prim index is specified for \p prim if
1855 // \p parent is in a prototype.
1856 void _ComposeChildSubtree(Usd_PrimDataPtr prim,
1857 Usd_PrimDataConstPtr parent,
1858 UsdStagePopulationMask const *mask);
1859
1860 // Compose \p prim's list of children and make any modifications necessary
1861 // to its _children member and the stage's _primMap, including possibly
1862 // instantiating new prims, or destroying existing subtrees of prims. The
1863 // any newly created prims *do not* have their prim index, type, flags, or
1864 // children composed.
1865 //
1866 // Compose only \p prim's direct children if recurse=false. Otherwise
1867 // recompose every descendent of \p prim. Callers that pass recurse=false
1868 // should invoke _ComposeSubtree on any newly created prims to ensure caches
1869 // are correctly populated.
1870 void _ComposeChildren(Usd_PrimDataPtr prim,
1871 UsdStagePopulationMask const *mask, bool recurse);
1872
1873 // Instantiate a prim instance. There must not already be an instance
1874 // at \p primPath.
1875 Usd_PrimDataPtr _InstantiatePrim(const SdfPath &primPath);
1876
1877 // Instantiate a prototype prim and sets its parent to pseudoroot.
1878 // There must not already be a prototype at \p primPath.
1879 Usd_PrimDataPtr _InstantiatePrototypePrim(const SdfPath &primPath);
1880
1881 // For \p prim and all of its descendants, remove from _primMap and empty
1882 // their _children vectors.
1883 void _DestroyPrim(Usd_PrimDataPtr prim);
1884
1885 // Destroy the prim subtrees rooted at each path in \p paths. \p paths may
1886 // not contain any path that is a descendent of another path in \p paths.
1887 void _DestroyPrimsInParallel(const std::vector<SdfPath>& paths);
1888
1889 // Invoke _DestroyPrim() on all of \p prim's direct children.
1890 void _DestroyDescendents(Usd_PrimDataPtr prim);
1891
1892 // Returns true if the object at the given path is a descendant of
1893 // an instance prim, i.e. a prim beneath an instance prim, or a property
1894 // of a prim beneath an instance prim.
1895 bool _IsObjectDescendantOfInstance(const SdfPath& path) const;
1896
1897 // If the given prim is an instance, returns the corresponding
1898 // prototype prim. Otherwise, returns an invalid prim.
1899 Usd_PrimDataConstPtr _GetPrototypeForInstance(Usd_PrimDataConstPtr p) const;
1900
1901 // Returns the path of the Usd prim using the prim index at the given path.
1902 SdfPath _GetPrimPathUsingPrimIndexAtPath(const SdfPath& primIndexPath) const;
1903
1904 // Responds to LayersDidChangeSentPerLayer event and update stage contents
1905 // in response to changes in scene description.
1906 void _HandleLayersDidChange(const SdfNotice::LayersDidChangeSentPerLayer &);
1907
1908 // Pushes changes through PCP to determine invalidation based on
1909 // composition metadata.
1910 void _ProcessChangeLists(const SdfLayerChangeListVec &);
1911
1912 // Update stage contents in response to changes to the asset resolver.
1913 void _HandleResolverDidChange(const ArNotice::ResolverChanged &);
1914
1915 // Process stage change information stored in _pendingChanges.
1916 // _pendingChanges will be set to nullptr by the end of the function.
1917 void _ProcessPendingChanges();
1918
1919 // Remove scene description for the prim at \p fullPath in the current edit
1920 // target.
1921 bool _RemovePrim(const SdfPath& fullPath);
1922
1923 SdfPrimSpecHandle _GetPrimSpec(const SdfPath& fullPath);
1924
1925 // Find and return the defining spec type for the property spec at the given
1926 // path, or SdfSpecTypeUnknown if none exists. The defining spec type is
1927 // either the builtin definition's spec type, if the indicated property is
1928 // builtin, otherwise it's the strongest authored spec's type if one exists,
1929 // otherwise it's SdfSpecTypeUnknown.
1930 SdfSpecType _GetDefiningSpecType(Usd_PrimDataConstPtr primData,
1931 const TfToken &propName) const;
1932
1933 // Helper to apply Pcp changes and recompose the scenegraph accordingly,
1934 // given an optional initial set of paths to recompose.
1935 void _Recompose(const PcpChanges &changes);
1936 template <class T>
1937 void _Recompose(const PcpChanges &changes, T *pathsToRecompose);
1938 template <class T>
1939 void _RecomposePrims(T *pathsToRecompose);
1940
1941 // Helper for _Recompose to find the subtrees that need to be
1942 // fully recomposed and to recompose the name children of the
1943 // parents of these subtrees. Note that [start, finish) must be a
1944 // sorted range of map iterators whose keys are paths with no descendent
1945 // paths. In C++20, consider using the ranges API to improve this.
1946 template <class Iter>
1947 void _ComputeSubtreesToRecompose(Iter start, Iter finish,
1948 std::vector<Usd_PrimDataPtr>* recompose);
1949
1950 // return true if the path is valid for load/unload operations.
1951 // This method will emit errors when invalid paths are encountered.
1952 bool _IsValidForLoad(const SdfPath& path) const;
1953 bool _IsValidForUnload(const SdfPath& path) const;
1954
1955 // Discover all payloads in a given subtree, adding the path of each
1956 // discovered prim index to the \p primIndexPaths set. If specified,
1957 // the corresponding UsdPrim path will be added to the \p usdPrimPaths
1958 // set. The root path will be considered for inclusion in the result set.
1959 //
1960 // Note that some payloads may not be discoverable in until an ancestral
1961 // payload has been included. UsdStage::LoadAndUnload takes this into
1962 // account.
1963 void _DiscoverPayloads(const SdfPath& rootPath,
1964 UsdLoadPolicy policy,
1965 SdfPathSet* primIndexPaths,
1966 bool unloadedOnly = false,
1967 SdfPathSet* usdPrimPaths = nullptr) const;
1968
1969 // ===================================================================== //
1970 // VALUE RESOLUTION //
1971 // ===================================================================== //
1972 // --------------------------------------------------------------------- //
1973 // Specialized Value Resolution
1974 // --------------------------------------------------------------------- //
1975
1976 // Helpers for resolving values for metadata fields requiring
1977 // special behaviors.
1978 static SdfSpecifier _GetSpecifier(Usd_PrimDataConstPtr primData);
1979 static TfToken _GetKind(Usd_PrimDataConstPtr primData);
1980 static bool _IsActive(Usd_PrimDataConstPtr primData);
1981
1982 // Custom is true if it is true anywhere in the stack.
1983 bool _IsCustom(const UsdProperty &prop) const;
1984
1985 // Variability is determined by the weakest opinion in the stack.
1986 SdfVariability _GetVariability(const UsdProperty &prop) const;
1987
1988 // Helper functions for resolving asset paths during value resolution.
1989 void _MakeResolvedAssetPaths(UsdTimeCode time, const UsdAttribute &attr,
1990 SdfAssetPath *assetPaths,
1991 size_t numAssetPaths,
1992 bool anchorAssetPathsOnly = false) const;
1993
1994 void _MakeResolvedAssetPathsValue(UsdTimeCode time, const UsdAttribute &attr,
1995 VtValue *value,
1996 bool anchorAssetPathsOnly = false) const;
1997
1998 void _MakeResolvedTimeCodes(UsdTimeCode time, const UsdAttribute &attr,
1999 SdfTimeCode *timeCodes,
2000 size_t numTimeCodes) const;
2001
2002 void _MakeResolvedPathExpressions(
2003 UsdTimeCode time, const UsdAttribute &attr,
2004 SdfPathExpression *pathExprs,
2005 size_t numPathExprs) const;
2006
2007 void _MakeResolvedAttributeValue(UsdTimeCode time, const UsdAttribute &attr,
2008 VtValue *value) const;
2009
2010 // --------------------------------------------------------------------- //
2011 // Metadata Resolution
2012 // --------------------------------------------------------------------- //
2013
2014public:
2015 // Trait that allows us to call the correct version of _GetMetadata for
2016 // types that require type specific value resolution as opposed to just
2017 // strongest opinion. These types also use type specific resolution
2018 // in _GetValue.
2019 template <class T>
2020 struct _HasTypeSpecificResolution {
2021 static const bool value =
2022 std::is_same<T, SdfAssetPath>::value ||
2023 std::is_same<T, VtArray<SdfAssetPath>>::value ||
2024 std::is_same<T, SdfTimeCode>::value ||
2025 std::is_same<T, VtArray<SdfTimeCode>>::value ||
2026 std::is_same<T, SdfPathExpression>::value ||
2027 std::is_same<T, VtArray<SdfPathExpression>>::value ||
2028 std::is_same<T, SdfTimeSampleMap>::value ||
2029 std::is_same<T, TsSpline>::value ||
2030 std::is_same<T, VtDictionary>::value;
2031 };
2032
2033private:
2034 // Get metadata for types that do not have type specific value resolution.
2035 template <class T>
2036 typename std::enable_if<!_HasTypeSpecificResolution<T>::value, bool>::type
2037 _GetMetadata(const UsdObject &obj,
2038 const TfToken& fieldName,
2039 const TfToken &keyPath,
2040 bool useFallbacks,
2041 T* result) const;
2042
2043 // Get metadata for types that do have type specific value resolution.
2044 template <class T>
2045 typename std::enable_if<_HasTypeSpecificResolution<T>::value, bool>::type
2046 _GetMetadata(const UsdObject &obj,
2047 const TfToken& fieldName,
2048 const TfToken &keyPath,
2049 bool useFallbacks,
2050 T* result) const;
2051
2052 // Get metadata as a dynamically typed VtValue. Will perform type specific
2053 // value resolution if the returned held type requires it.
2054 bool _GetMetadata(const UsdObject &obj,
2055 const TfToken& fieldName,
2056 const TfToken &keyPath,
2057 bool useFallbacks,
2058 VtValue* result) const;
2059
2060 // Gets a metadata value using only strongest value resolution. It is
2061 // assumed that result is holding a value that does not require type
2062 // specific value resolution.
2063 USD_API
2064 bool _GetStrongestResolvedMetadata(const UsdObject &obj,
2065 const TfToken& fieldName,
2066 const TfToken &keyPath,
2067 bool useFallbacks,
2068 SdfAbstractDataValue* result) const;
2069
2070 // Gets a metadata value with the type specific value resolution for the
2071 // type applied. This is only implemented for types that
2072 // _HasTypeSpecificResolution.
2073 template <class T>
2074 USD_API
2075 bool _GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2076 const TfToken& fieldName,
2077 const TfToken &keyPath,
2078 bool useFallbacks,
2079 T* result) const;
2080
2081 template <class Composer>
2082 void _GetAttrTypeImpl(const UsdAttribute &attr,
2083 const TfToken &fieldName,
2084 bool useFallbacks,
2085 Composer *composer) const;
2086
2087 template <class Composer>
2088 void _GetAttrVariabilityImpl(const UsdAttribute &attr,
2089 bool useFallbacks,
2090 Composer *composer) const;
2091
2092 template <class Composer>
2093 void _GetPropCustomImpl(const UsdProperty &prop,
2094 bool useFallbacks,
2095 Composer *composer) const;
2096
2097 template <class Composer>
2098 bool _GetSpecialPropMetadataImpl(const UsdObject &obj,
2099 const TfToken &fieldName,
2100 const TfToken &keyPath,
2101 bool useFallbacks,
2102 Composer *composer) const;
2103 template <class Composer>
2104 bool _GetMetadataImpl(const UsdObject &obj,
2105 const TfToken& fieldName,
2106 const TfToken& keyPath,
2107 bool includeFallbacks,
2108 Composer *composer) const;
2109
2110 template <class Composer>
2111 bool _GetGeneralMetadataImpl(const UsdObject &obj,
2112 const TfToken& fieldName,
2113 const TfToken& keyPath,
2114 bool includeFallbacks,
2115 Composer *composer) const;
2116
2117 // NOTE: The "authoredOnly" flag is not yet in use, but when we have
2118 // support for prim-based metadata fallbacks, they should be ignored when
2119 // this flag is set to true.
2120 bool _HasMetadata(const UsdObject &obj, const TfToken& fieldName,
2121 const TfToken &keyPath, bool useFallbacks) const;
2122
2124 _ListMetadataFields(const UsdObject &obj, bool useFallbacks) const;
2125
2126 void _GetAllMetadata(const UsdObject &obj,
2127 bool useFallbacks,
2128 UsdMetadataValueMap* result,
2129 bool anchorAssetPathsOnly = false) const;
2130
2131 // --------------------------------------------------------------------- //
2132 // Default & TimeSample Resolution
2133 // --------------------------------------------------------------------- //
2134
2135 void _GetResolveInfo(const UsdAttribute &attr,
2136 UsdResolveInfo *resolveInfo,
2137 const UsdTimeCode *time = nullptr) const;
2138
2139 void _GetResolveInfoWithResolveTarget(
2140 const UsdAttribute &attr,
2141 const UsdResolveTarget &resolveTarget,
2142 UsdResolveInfo *resolveInfo,
2143 const UsdTimeCode *time = nullptr) const;
2144
2145 template <class T> struct _ExtraResolveInfo;
2146
2147 // Gets the value resolve info for the given attribute. If time is provided,
2148 // the resolve info is evaluated for that specific time (which may be
2149 // default). Otherwise, if time is null, the resolve info is evaluated for
2150 // "any numeric time" and will not populate values in extraInfo that
2151 // require a specific time to be evaluated.
2152 template <class T>
2153 void _GetResolveInfo(const UsdAttribute &attr,
2154 UsdResolveInfo *resolveInfo,
2155 const UsdTimeCode *time = nullptr,
2156 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2157
2158 // Gets the value resolve info for the given attribute using the given
2159 // resolve target. If time is provided, the resolve info is evaluated for
2160 // that specific time (which may be default). Otherwise, if time is null,
2161 // the resolve info is evaluated for "any numeric time" and will not
2162 // populate values in extraInfo that require a specific time to be
2163 // evaluated.
2164 template <class T>
2165 void _GetResolveInfoWithResolveTarget(
2166 const UsdAttribute &attr,
2167 const UsdResolveTarget &resolveTarget,
2168 UsdResolveInfo *resolveInfo,
2169 const UsdTimeCode *time = nullptr,
2170 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2171
2172 // Shared implementation function for _GetResolveInfo and
2173 // _GetResolveInfoWithResolveTarget. The only difference between how these
2174 // two functions behave is in how they create the Usd_Resolver used for
2175 // iterating over nodes and layers, thus they provide this implementation
2176 // with the needed MakeUsdResolverFn to create the Usd_Resolver.
2177 template <class T, class MakeUsdResolverFn>
2178 void _GetResolveInfoImpl(const UsdAttribute &attr,
2179 UsdResolveInfo *resolveInfo,
2180 const UsdTimeCode *time,
2181 _ExtraResolveInfo<T> *extraInfo,
2182 const MakeUsdResolverFn &makeUsdResolveFn) const;
2183
2184 template <class T> struct _ResolveInfoResolver;
2185 struct _PropertyStackResolver;
2186
2187 template <class Resolver, class MakeUsdResolverFn>
2188 void _GetResolvedValueAtDefaultImpl(
2189 const UsdProperty &prop,
2190 Resolver *resolver,
2191 const MakeUsdResolverFn &makeUsdResolverFn) const;
2192
2193 template <class Resolver, class MakeUsdResolverFn>
2194 void _GetResolvedValueAtTimeImpl(
2195 const UsdProperty &prop,
2196 Resolver *resolver,
2197 const double *time,
2198 const MakeUsdResolverFn &makeUsdResolverFn) const;
2199
2200 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2201 VtValue* result) const;
2202
2203 template <class T>
2204 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2205 T* result) const;
2206
2207 template <class T>
2208 bool _GetValueImpl(UsdTimeCode time, const UsdAttribute &attr,
2209 Usd_InterpolatorBase* interpolator,
2210 T* value) const;
2211
2212 USD_API
2213 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2214 UsdTimeCode time, const UsdAttribute &attr,
2215 VtValue* result) const;
2216
2217 template <class T>
2218 USD_API
2219 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2220 UsdTimeCode time, const UsdAttribute &attr,
2221 T* result) const;
2222
2223 template <class T>
2224 bool _GetValueFromResolveInfoImpl(const UsdResolveInfo &info,
2225 UsdTimeCode time, const UsdAttribute &attr,
2226 Usd_InterpolatorBase* interpolator,
2227 T* value) const;
2228
2229 template <class T>
2230 bool _GetDefaultValueFromResolveInfoImpl(const UsdResolveInfo &info,
2231 const UsdAttribute &attr,
2232 T* value) const;
2233
2234 Usd_AssetPathContext
2235 _GetAssetPathContext(UsdTimeCode time, const UsdAttribute &attr) const;
2236
2237 // --------------------------------------------------------------------- //
2238 // Specialized Time Sample I/O
2239 // --------------------------------------------------------------------- //
2240
2247 bool _GetTimeSamplesInInterval(const UsdAttribute &attr,
2248 const GfInterval& interval,
2249 std::vector<double>* times) const;
2250
2251 bool _GetTimeSamplesInIntervalFromResolveInfo(
2252 const UsdResolveInfo &info,
2253 const UsdAttribute &attr,
2254 const GfInterval& interval,
2255 std::vector<double>* times) const;
2256
2257 size_t _GetNumTimeSamples(const UsdAttribute &attr) const;
2258
2259 size_t _GetNumTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2260 const UsdAttribute &attr) const;
2261
2265 bool _GetBracketingTimeSamples(const UsdAttribute &attr,
2266 double desiredTime,
2267 bool authoredOnly,
2268 double* lower,
2269 double* upper,
2270 bool* hasSamples) const;
2271
2272 bool _GetBracketingTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2273 const UsdAttribute &attr,
2274 double desiredTime,
2275 bool authoredOnly,
2276 double* lower,
2277 double* upper,
2278 bool* hasSamples) const;
2279
2280 bool _ValueMightBeTimeVarying(const UsdAttribute &attr) const;
2281
2282 bool _ValueMightBeTimeVaryingFromResolveInfo(const UsdResolveInfo &info,
2283 const UsdAttribute &attr) const;
2284
2285 void _RegisterPerLayerNotices();
2286 void _RegisterResolverChangeNotice();
2287
2288 // Helper to obtain a malloc tag string for this stage.
2289 inline char const *_GetMallocTagId() const;
2290
2291private:
2292
2293 // The 'pseudo root' prim.
2294 Usd_PrimDataPtr _pseudoRoot;
2295
2296 // The stage's root layer.
2297 SdfLayerRefPtr _rootLayer;
2298
2299 // Every UsdStage has an implicit, in-memory session layer.
2300 // This is to allow for runtime overrides such as variant selections.
2301 SdfLayerRefPtr _sessionLayer;
2302
2303 // The stage's EditTarget.
2304 UsdEditTarget _editTarget;
2305 bool _editTargetIsLocalLayer;
2306
2307 std::unique_ptr<PcpCache> _cache;
2308 std::unique_ptr<Usd_ClipCache> _clipCache;
2309 std::unique_ptr<Usd_InstanceCache> _instanceCache;
2310
2311 TfHashMap<TfToken, TfToken, TfHash> _invalidPrimTypeToFallbackMap;
2312
2313 size_t _usedLayersRevision;
2314
2315 // A concurrent map from Path to Prim, for fast random access.
2316 struct _TbbHashEq {
2317 inline bool equal(SdfPath const &l, SdfPath const &r) const {
2318 return l == r;
2319 }
2320 inline size_t hash(SdfPath const &path) const {
2321 return path.GetHash();
2322 }
2323 };
2324 using PathToNodeMap = tbb::concurrent_hash_map<
2325 SdfPath, Usd_PrimDataIPtr, _TbbHashEq>;
2326 PathToNodeMap _primMap;
2327
2328 // The interpolation type used for all attributes on the stage.
2329 UsdInterpolationType _interpolationType;
2330
2331 typedef std::vector<
2332 std::pair<SdfLayerHandle, TfNotice::Key> > _LayerAndNoticeKeyVec;
2333 _LayerAndNoticeKeyVec _layersAndNoticeKeys;
2334 size_t _lastChangeSerialNumber;
2335
2336 TfNotice::Key _resolverChangeKey;
2337
2338 // Data for pending change processing.
2339 class _PendingChanges;
2340 _PendingChanges* _pendingChanges;
2341
2342 std::optional<WorkDispatcher> _dispatcher;
2343
2344 // To provide useful aggregation of malloc stats, we bill everything
2345 // for this stage - from all access points - to this tag.
2346 std::unique_ptr<std::string> _mallocTagID;
2347
2348 // The state used when instantiating the stage.
2349 const InitialLoadSet _initialLoadSet;
2350
2351 // The population mask that applies to this stage.
2352 UsdStagePopulationMask _populationMask;
2353
2354 // The load rules that apply to this stage.
2355 UsdStageLoadRules _loadRules;
2356
2357 bool _isClosingStage;
2358 bool _isWritingFallbackPrimTypes;
2359
2360 friend class UsdAPISchemaBase;
2361 friend class UsdAttribute;
2362 friend class UsdAttributeQuery;
2363 friend class UsdEditTarget;
2364 friend class UsdInherits;
2365 friend class UsdNamespaceEditor;
2366 friend class UsdObject;
2367 friend class UsdPrim;
2368 friend class UsdProperty;
2369 friend class UsdRelationship;
2370 friend class UsdSpecializes;
2371 friend class UsdVariantSet;
2372 friend class UsdVariantSets;
2373 friend class Usd_AssetPathContext;
2374 friend class Usd_FlattenAccess;
2375 friend class Usd_PcpCacheAccess;
2376 friend class Usd_PrimData;
2377 friend class Usd_StageOpenRequest;
2378 friend class Usd_TypeQueryAccess;
2379 template <class T> friend struct Usd_AttrGetValueHelper;
2380 friend struct Usd_AttrGetUntypedValueHelper;
2381 template <class RefsOrPayloadsEditorType, class RefsOrPayloadsProxyType>
2382 friend struct Usd_ListEditImpl;
2383};
2384
2385// UsdObject's typed metadata query relies on this specialization being
2386// externally visible and exporting the primary template does not
2387// automatically export this specialization.
2388template <>
2389USD_API
2390bool
2391UsdStage::_GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2392 const TfToken& fieldName,
2393 const TfToken &keyPath,
2394 bool useFallbacks,
2395 SdfTimeSampleMap* result) const;
2396
2397template<typename T>
2398bool
2399UsdStage::GetMetadata(const TfToken& key, T* value) const
2400{
2401 VtValue result;
2402 if (!GetMetadata(key, &result)){
2403 return false;
2404 }
2405
2406 if (result.IsHolding<T>()){
2407 *value = result.UncheckedGet<T>();
2408 return true;
2409 } else {
2410 TF_CODING_ERROR("Requested type %s for stage metadatum %s does not"
2411 " match retrieved type %s",
2412 ArchGetDemangled<T>().c_str(),
2413 key.GetText(),
2414 result.GetTypeName().c_str());
2415 return false;
2416 }
2417}
2418
2419template<typename T>
2420bool
2421UsdStage::SetMetadata(const TfToken& key, const T& value) const
2422{
2423 VtValue in(value);
2424 return SetMetadata(key, in);
2425}
2426
2427template<typename T>
2428bool
2430 T* value) const
2431{
2432 VtValue result;
2433 if (!GetMetadataByDictKey(key, keyPath, &result)){
2434 return false;
2435 }
2436
2437 if (result.IsHolding<T>()){
2438 *value = result.UncheckedGet<T>();
2439 return true;
2440 } else {
2441 TF_CODING_ERROR("Requested type %s for stage metadatum %s[%s] does not"
2442 " match retrieved type %s",
2443 ArchGetDemangled<T>().c_str(),
2444 key.GetText(),
2445 keyPath.GetText(),
2446 result.GetTypeName().c_str());
2447 return false;
2448 }
2449}
2450
2451template<typename T>
2452bool
2454 const T& value) const
2455{
2456 VtValue in(value);
2457 return SetMetadataByDictKey(key, keyPath, in);
2458}
2459
2460// Get metadata for types that do not have type specific value resolution.
2461template <class T>
2462typename std::enable_if<
2463 !UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2464UsdStage::_GetMetadata(const UsdObject &obj,
2465 const TfToken& fieldName,
2466 const TfToken &keyPath,
2467 bool useFallbacks,
2468 T* result) const
2469{
2470 // Since these types don't have type specific value resolution, we can just
2471 // get the strongest metadata value and be done.
2472 SdfAbstractDataTypedValue<T> out(result);
2473 return _GetStrongestResolvedMetadata(
2474 obj, fieldName, keyPath, useFallbacks, &out);
2475}
2476
2477// Get metadata for types that do have type specific value resolution.
2478template <class T>
2479typename std::enable_if<
2480 UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2481UsdStage::_GetMetadata(const UsdObject &obj,
2482 const TfToken& fieldName,
2483 const TfToken &keyPath,
2484 bool useFallbacks,
2485 T* result) const
2486{
2487 // Call the templated type specifice resolved metadata implementation that
2488 // will only be implemented for types that support it.
2489 return _GetTypeSpecificResolvedMetadata(
2490 obj, fieldName, keyPath, useFallbacks, result);
2491}
2492
2493
2494// Set metadata for types that don't need to be mapped across edit targets.
2495template <class T>
2496typename std::enable_if<!UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2497UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2498 const TfToken &keyPath, const T& value)
2499{
2500 // Since we know that we don't need to map the value for edit targets,
2501 // we can just type erase the value and set the metadata as is.
2503 return _SetMetadataImpl<SdfAbstractDataConstValue>(
2504 object, key, keyPath, in);
2505}
2506
2507// Set metadata for types that do need to be mapped for edit targets.
2508template <class T>
2509typename std::enable_if<UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2510UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2511 const TfToken &keyPath, const T& value)
2512{
2513 return _SetEditTargetMappedMetadata(object, key, keyPath, value);
2514}
2515
2516PXR_NAMESPACE_CLOSE_SCOPE
2517
2518#endif //PXR_USD_USD_STAGE_H
2519
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: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
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:2421
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:2453
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:2429
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:2399
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