Loading...
Searching...
No Matches
stage.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_USD_STAGE_H
25#define PXR_USD_USD_STAGE_H
26
28
29#include "pxr/pxr.h"
30#include "pxr/usd/usd/api.h"
31#include "pxr/usd/usd/common.h"
32#include "pxr/usd/usd/editTarget.h"
34#include "pxr/usd/usd/schemaRegistry.h"
36#include "pxr/usd/usd/stagePopulationMask.h"
37#include "pxr/usd/usd/primDefinition.h"
39
41#include "pxr/base/tf/hashmap.h"
43
44#include "pxr/usd/ar/ar.h"
45#include "pxr/usd/ar/notice.h"
47#include "pxr/usd/sdf/notice.h"
48#include "pxr/usd/sdf/path.h"
49#include "pxr/usd/sdf/types.h"
50#include "pxr/usd/pcp/cache.h"
51#include "pxr/base/vt/value.h"
53
54#include <boost/optional.hpp>
55
56#include <tbb/concurrent_vector.h>
57#include <tbb/concurrent_unordered_set.h>
58#include <tbb/concurrent_hash_map.h>
59#include <tbb/spin_rw_mutex.h>
60
61#include <functional>
62#include <string>
63#include <memory>
64#include <unordered_map>
65#include <utility>
66
67PXR_NAMESPACE_OPEN_SCOPE
68
70class GfInterval;
72class Usd_AssetPathContext;
73class Usd_ClipCache;
74class Usd_InstanceCache;
75class Usd_InstanceChanges;
76class Usd_InterpolatorBase;
77class Usd_Resolver;
78class UsdResolveInfo;
80class UsdPrim;
81class UsdPrimRange;
82
83SDF_DECLARE_HANDLES(SdfLayer);
84
152class UsdStage : public TfRefBase, public TfWeakBase {
153public:
154
155 // --------------------------------------------------------------------- //
159 // --------------------------------------------------------------------- //
160
166 {
168 LoadNone
169 };
170
181 //
193 USD_API
194 static UsdStageRefPtr
195 CreateNew(const std::string& identifier,
196 InitialLoadSet load = LoadAll);
198 USD_API
199 static UsdStageRefPtr
200 CreateNew(const std::string& identifier,
201 const SdfLayerHandle& sessionLayer,
202 InitialLoadSet load = LoadAll);
204 USD_API
205 static UsdStageRefPtr
206 CreateNew(const std::string& identifier,
207 const SdfLayerHandle& sessionLayer,
208 const ArResolverContext& pathResolverContext,
209 InitialLoadSet load = LoadAll);
211 USD_API
212 static UsdStageRefPtr
213 CreateNew(const std::string& identifier,
214 const ArResolverContext& pathResolverContext,
215 InitialLoadSet load = LoadAll);
216
234 USD_API
235 static UsdStageRefPtr
238 USD_API
239 static UsdStageRefPtr
240 CreateInMemory(const std::string& identifier,
241 InitialLoadSet load = LoadAll);
243 USD_API
244 static UsdStageRefPtr
245 CreateInMemory(const std::string& identifier,
246 const ArResolverContext& pathResolverContext,
247 InitialLoadSet load = LoadAll);
249 USD_API
250 static UsdStageRefPtr
251 CreateInMemory(const std::string& identifier,
252 const SdfLayerHandle &sessionLayer,
253 InitialLoadSet load = LoadAll);
255 USD_API
256 static UsdStageRefPtr
257 CreateInMemory(const std::string& identifier,
258 const SdfLayerHandle &sessionLayer,
259 const ArResolverContext& pathResolverContext,
260 InitialLoadSet load = LoadAll);
261
277 USD_API
278 static UsdStageRefPtr
279 Open(const std::string& filePath, InitialLoadSet load = LoadAll);
281 USD_API
282 static UsdStageRefPtr
283 Open(const std::string& filePath,
284 const ArResolverContext& pathResolverContext,
285 InitialLoadSet load = LoadAll);
286
304 USD_API
305 static UsdStageRefPtr
306 OpenMasked(const std::string &filePath,
307 UsdStagePopulationMask const &mask,
308 InitialLoadSet load = LoadAll);
310 USD_API
311 static UsdStageRefPtr
312 OpenMasked(const std::string &filePath,
313 const ArResolverContext &pathResolverContext,
314 UsdStagePopulationMask const &mask,
315 InitialLoadSet load = LoadAll);
316
345 USD_API
346 static UsdStageRefPtr
347 Open(const SdfLayerHandle& rootLayer,
350 USD_API
351 static UsdStageRefPtr
352 Open(const SdfLayerHandle& rootLayer,
353 const SdfLayerHandle& sessionLayer,
356 USD_API
357 static UsdStageRefPtr
358 Open(const SdfLayerHandle& rootLayer,
359 const ArResolverContext& pathResolverContext,
362 USD_API
363 static UsdStageRefPtr
364 Open(const SdfLayerHandle& rootLayer,
365 const SdfLayerHandle& sessionLayer,
366 const ArResolverContext& pathResolverContext,
368
389 USD_API
390 static UsdStageRefPtr
391 OpenMasked(const SdfLayerHandle& rootLayer,
392 const UsdStagePopulationMask &mask,
395 USD_API
396 static UsdStageRefPtr
397 OpenMasked(const SdfLayerHandle& rootLayer,
398 const SdfLayerHandle& sessionLayer,
399 const UsdStagePopulationMask &mask,
402 USD_API
403 static UsdStageRefPtr
404 OpenMasked(const SdfLayerHandle& rootLayer,
405 const ArResolverContext& pathResolverContext,
406 const UsdStagePopulationMask &mask,
409 USD_API
410 static UsdStageRefPtr
411 OpenMasked(const SdfLayerHandle& rootLayer,
412 const SdfLayerHandle& sessionLayer,
413 const ArResolverContext& pathResolverContext,
414 const UsdStagePopulationMask &mask,
416
417 USD_API
418 virtual ~UsdStage();
419
437 USD_API
438 void Reload();
439
448 USD_API
449 static bool
450 IsSupportedFile(const std::string& filePath);
451
453
454 // --------------------------------------------------------------------- //
463
471 USD_API
472 void Save();
473
481 USD_API
483
485
486 // --------------------------------------------------------------------- //
532
534 USD_API
536
542 USD_API
543 static void
545
547
548 // --------------------------------------------------------------------- //
577 // --------------------------------------------------------------------- //
578
586 USD_API
589
595 USD_API
597
609 USD_API
610 void LoadAndUnload(const SdfPathSet &loadSet, const SdfPathSet &unloadSet,
612
623 USD_API
624 SdfPathSet GetLoadSet();
625
645 USD_API
646 SdfPathSet FindLoadable(
647 const SdfPath& rootPath = SdfPath::AbsoluteRootPath());
648
655 return _loadRules;
656 }
657
667 USD_API
668 void SetLoadRules(UsdStageLoadRules const &rules);
669
672 return _populationMask;
673 }
674
676 USD_API
678
690 USD_API
692 std::function<bool (UsdRelationship const &)> const &relPred = nullptr,
693 std::function<bool (UsdAttribute const &)> const &attrPred = nullptr);
694
696
697 // --------------------------------------------------------------------- //
706 // --------------------------------------------------------------------- //
707
717 USD_API
719
726 USD_API
728
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
863 USD_API
865
870 USD_API
871 UsdPrimRange Traverse(const Usd_PrimFlagsPredicate &predicate);
872
877 USD_API
879
898 USD_API
900
924 USD_API
926 const TfToken &typeName=TfToken());
927
940 USD_API
941 UsdPrim CreateClassPrim(const SdfPath &rootPrimPath);
942
964 USD_API
965 bool RemovePrim(const SdfPath& path);
966
968
969 // --------------------------------------------------------------------- //
973 // --------------------------------------------------------------------- //
974
976 USD_API
977 SdfLayerHandle GetSessionLayer() const;
978
980 USD_API
981 SdfLayerHandle GetRootLayer() const;
982
987 USD_API
989
999 USD_API
1000 std::string
1001 ResolveIdentifierToEditTarget(std::string const &identifier) const;
1002
1009 USD_API
1010 SdfLayerHandleVector GetLayerStack(bool includeSessionLayers=true) const;
1011
1023 USD_API
1024 SdfLayerHandleVector GetUsedLayers(bool includeClipLayers=true) const;
1025
1028 USD_API
1029 bool HasLocalLayer(const SdfLayerHandle &layer) const;
1030
1032 USD_API
1034
1038 USD_API
1040
1044 USD_API
1045 UsdEditTarget GetEditTargetForLocalLayer(const SdfLayerHandle &layer);
1046
1053 USD_API
1054 void SetEditTarget(const UsdEditTarget &editTarget);
1055
1082 USD_API
1083 void MuteLayer(const std::string &layerIdentifier);
1084
1087 USD_API
1088 void UnmuteLayer(const std::string &layerIdentifier);
1089
1097 USD_API
1098 void MuteAndUnmuteLayers(const std::vector<std::string> &muteLayers,
1099 const std::vector<std::string> &unmuteLayers);
1100
1102 USD_API
1103 const std::vector<std::string>& GetMutedLayers() const;
1104
1109 USD_API
1110 bool IsLayerMuted(const std::string& layerIdentifier) const;
1111
1113
1114 // --------------------------------------------------------------------- //
1118 // --------------------------------------------------------------------- //
1119 // Future Work:
1120 // * Flatten sub-trees or individual prims
1121 // * Allow flattening of local LayerStack
1122 // * Move Flatten into a free-function to ensure it doesn't rely on
1123 // Stage internals.
1124
1132 USD_API
1133 bool Export(const std::string &filename,
1134 bool addSourceFileComment=true,
1135 const SdfLayer::FileFormatArguments &args =
1137
1145 USD_API
1146 bool ExportToString(std::string *result,
1147 bool addSourceFileComment=true) const;
1148
1175 USD_API
1176 SdfLayerRefPtr Flatten(bool addSourceFileComment=true) const;
1178
1179public:
1180 // --------------------------------------------------------------------- //
1188 // --------------------------------------------------------------------- //
1189
1201 template <class T>
1202 bool GetMetadata(const TfToken &key, T *value) const;
1204 USD_API
1205 bool GetMetadata(const TfToken &key, VtValue *value) const;
1206
1213 USD_API
1214 bool HasMetadata(const TfToken &key) const;
1215
1224 USD_API
1225 bool HasAuthoredMetadata(const TfToken &key) const;
1226
1235 template<typename T>
1236 bool SetMetadata(const TfToken &key, const T &value) const;
1238 USD_API
1239 bool SetMetadata(const TfToken &key, const VtValue &value) const;
1240
1249 USD_API
1250 bool ClearMetadata(const TfToken &key) const;
1251
1267 template<typename T>
1268 bool GetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1269 T* value) const;
1271 USD_API
1273 const TfToken& key, const TfToken &keyPath, VtValue *value) const;
1274
1285 USD_API
1287 const TfToken& key, const TfToken &keyPath) const;
1288
1297 USD_API
1299 const TfToken& key, const TfToken &keyPath) const;
1300
1312 template<typename T>
1313 bool SetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1314 const T& value) const;
1316 USD_API
1318 const TfToken& key, const TfToken &keyPath, const VtValue& value) const;
1319
1331 USD_API
1333 const TfToken& key, const TfToken& keyPath) const;
1334
1353 USD_API
1355
1357
1358 // --------------------------------------------------------------------- //
1365 // --------------------------------------------------------------------- //
1369 USD_API
1370 double GetStartTimeCode() const;
1371
1378 USD_API
1379 void SetStartTimeCode(double);
1380
1384 USD_API
1385 double GetEndTimeCode() const;
1386
1393 USD_API
1394 void SetEndTimeCode(double);
1395
1398 USD_API
1400
1416 USD_API
1418
1427 USD_API
1428 void SetTimeCodesPerSecond(double timeCodesPerSecond) const;
1429
1439 USD_API
1440 double GetFramesPerSecond() const;
1441
1450 USD_API
1451 void SetFramesPerSecond(double framesPerSecond) const;
1452
1454
1455 // --------------------------------------------------------------------- //
1501 // --------------------------------------------------------------------- //
1502
1508 USD_API
1509 void SetColorConfiguration(const SdfAssetPath &colorConfig) const;
1510
1515 USD_API
1517
1522 USD_API
1523 void SetColorManagementSystem(const TfToken &cms) const;
1524
1529 USD_API
1531
1543 USD_API
1544 static void GetColorConfigFallbacks(SdfAssetPath *colorConfiguration,
1545 TfToken *colorManagementSystem);
1546
1560 USD_API
1561 static void
1562 SetColorConfigFallbacks(const SdfAssetPath &colorConfiguration,
1563 const TfToken &colorManagementSystem);
1564
1566
1567 // --------------------------------------------------------------------- //
1574 // --------------------------------------------------------------------- //
1575
1580 USD_API
1582
1585 USD_API
1587
1589
1590 // --------------------------------------------------------------------- //
1595 // --------------------------------------------------------------------- //
1596
1598 USD_API
1599 std::vector<UsdPrim> GetPrototypes() const;
1600
1602
1603private:
1604 struct _IncludePayloadsPredicate;
1605
1606 // --------------------------------------------------------------------- //
1607 // Stage Construction & Initialization
1608 // --------------------------------------------------------------------- //
1609
1610 UsdStage(const SdfLayerRefPtr& rootLayer,
1611 const SdfLayerRefPtr& sessionLayer,
1612 const ArResolverContext& pathResolverContext,
1613 const UsdStagePopulationMask& mask,
1614 InitialLoadSet load);
1615
1616 // Helper for Open() overloads -- searches and publishes to bound caches.
1617 template <class... Args>
1618 static UsdStageRefPtr _OpenImpl(InitialLoadSet load, Args const &... args);
1619
1620 // Releases resources used by this stage.
1621 void _Close();
1622
1623 // Common ref ptr initialization, called by public, static constructors.
1624 //
1625 // This method will either return a valid refptr (if the stage is correctly
1626 // initialized) or it will return a null ref pointer, deleting the
1627 // raw stage pointer in the process.
1628 static UsdStageRefPtr
1629 _InstantiateStage(const SdfLayerRefPtr &rootLayer,
1630 const SdfLayerRefPtr &sessionLayer,
1631 const ArResolverContext &pathResolverContext,
1632 const UsdStagePopulationMask &mask,
1633 InitialLoadSet load);
1634
1635 // --------------------------------------------------------------------- //
1636 // Spec Existence & Definition Helpers
1637 // --------------------------------------------------------------------- //
1638
1639 SdfPropertySpecHandleVector
1640 _GetPropertyStack(const UsdProperty &prop, UsdTimeCode time) const;
1641
1642 std::vector<std::pair<SdfPropertySpecHandle, SdfLayerOffset>>
1643 _GetPropertyStackWithLayerOffsets(
1644 const UsdProperty &prop, UsdTimeCode time) const;
1645
1646 static SdfPrimSpecHandleVector
1647 _GetPrimStack(const UsdPrim &prim);
1648
1649 static std::vector<std::pair<SdfPrimSpecHandle, SdfLayerOffset>>
1650 _GetPrimStackWithLayerOffsets(const UsdPrim &prim);
1651
1653 _GetSchemaProperty(const UsdProperty &prop) const;
1654
1656 _GetSchemaAttribute(const UsdAttribute &attr) const;
1657
1659 _GetSchemaRelationship(const UsdRelationship &rel) const;
1660
1661 SdfAttributeSpecHandle
1662 _CreateNewSpecFromSchemaAttribute(
1663 const UsdPrim &prim,
1664 const UsdPrimDefinition::Attribute &attrDef);
1665
1666 SdfRelationshipSpecHandle
1667 _CreateNewSpecFromSchemaRelationship(
1668 const UsdPrim &prim,
1669 const UsdPrimDefinition::Relationship &relDef);
1670
1671 template <class PropType>
1673 _CreateNewPropertySpecFromSchema(const UsdProperty &prop);
1674
1675 SdfPrimSpecHandle
1676 _CreatePrimSpecForEditing(const UsdPrim& prim);
1677
1678 template <class PropType>
1680 _CreatePropertySpecForEditing(const UsdProperty &prop);
1681
1682 SdfPropertySpecHandle
1683 _CreatePropertySpecForEditing(const UsdProperty &prop);
1684
1685 SdfAttributeSpecHandle
1686 _CreateAttributeSpecForEditing(const UsdAttribute &attr);
1687
1688 SdfRelationshipSpecHandle
1689 _CreateRelationshipSpecForEditing(const UsdRelationship &rel);
1690
1691 // Check if the given path is valid to use with the prim creation API,
1692 // like DefinePrim. If it is valid, returns (true, GetPrimAtPath(path)).
1693 // Otherwise, returns (false, UsdPrim()).
1694 std::pair<bool, UsdPrim>
1695 _IsValidPathForCreatingPrim(const SdfPath &path) const;
1696
1697 // Validates that editing a specified prim is allowed. If editing is not
1698 // allowed, issues a coding error like "Cannot <operation> ..." and
1699 // returns false. Otherwise, returns true.
1700 bool _ValidateEditPrim(const UsdPrim &prim, const char* operation) const;
1701 bool _ValidateEditPrimAtPath(const SdfPath &primPath,
1702 const char* operation) const;
1703
1704 UsdPrim _DefinePrim(const SdfPath &path, const TfToken &typeName);
1705
1706 bool _RemoveProperty(const SdfPath& path);
1707
1708 UsdProperty _FlattenProperty(const UsdProperty &srcProp,
1709 const UsdPrim &dstParent,
1710 const TfToken &dstName);
1711
1712 // --------------------------------------------------------------------- //
1713 // Value & Metadata Authoring
1714 // --------------------------------------------------------------------- //
1715
1716 // Trait that allows us to call the correct versions of _SetValue and
1717 // _SetMetadata for types whose values need to be mapped when written to
1718 // different edit targets.
1719 template <class T>
1720 struct _IsEditTargetMappable {
1721 static const bool value =
1722 std::is_same<T, SdfTimeCode>::value ||
1723 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1724 std::is_same<T, SdfPathExpression>::value ||
1725 std::is_same<T, VtArray<SdfPathExpression>>::value ||
1726 std::is_same<T, SdfTimeSampleMap>::value ||
1727 std::is_same<T, VtDictionary>::value;
1728 };
1729
1730 // Set value for types that don't need to be mapped for edit targets.
1731 template <class T>
1732 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1733 _SetValue(
1734 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1735
1736 // Set value for types that do need to be mapped for edit targets.
1737 template <class T>
1738 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1739 _SetValue(
1740 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1741
1742 // Set value for dynamically typed VtValue. Will map the value across edit
1743 // targets if the held value type supports it.
1744 bool _SetValue(
1745 UsdTimeCode time, const UsdAttribute &attr, const VtValue &newValue);
1746
1747 template <class T>
1748 bool _SetEditTargetMappedValue(
1749 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1750
1751 template <class T>
1752 bool _SetValueImpl(
1753 UsdTimeCode time, const UsdAttribute &attr, const T& value);
1754
1755 bool _ClearValue(UsdTimeCode time, const UsdAttribute &attr);
1756
1757 // Set metadata for types that don't need to be mapped across edit targets.
1758 template <class T>
1759 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1760 _SetMetadata(const UsdObject &object, const TfToken& key,
1761 const TfToken &keyPath, const T& value);
1762
1763 // Set metadata for types that do need to be mapped for edit targets.
1764 template <class T>
1765 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1766 _SetMetadata(const UsdObject &object, const TfToken& key,
1767 const TfToken &keyPath, const T& value);
1768
1769 // Set metadata for dynamically typed VtValue. Will map the value across
1770 // edit targets if the held value type supports it.
1771 USD_API
1772 bool _SetMetadata(const UsdObject &object,
1773 const TfToken& key,
1774 const TfToken &keyPath,
1775 const VtValue& value);
1776
1777 template <class T>
1778 bool _SetEditTargetMappedMetadata(
1779 const UsdObject &obj, const TfToken& fieldName,
1780 const TfToken &keyPath, const T &newValue);
1781
1782 template <class T>
1783 bool _SetMetadataImpl(
1784 const UsdObject &obj, const TfToken& fieldName,
1785 const TfToken &keyPath, const T &value);
1786
1787 bool _ClearMetadata(const UsdObject &obj, const TfToken& fieldName,
1788 const TfToken &keyPath=TfToken());
1789
1790 // --------------------------------------------------------------------- //
1791 // Misc Internal Helpers
1792 // --------------------------------------------------------------------- //
1793
1794 // Pcp helpers.
1795 PcpCache const *_GetPcpCache() const { return _cache.get(); }
1796 PcpCache *_GetPcpCache() { return _cache.get(); }
1797
1798 // Returns the PrimIndex, using the read-only PcpCache API. We expect prims
1799 // to be composed during initial stage composition, so this method should
1800 // not be used in that context.
1801 const PcpPrimIndex* _GetPcpPrimIndex(const SdfPath& primPath) const;
1802
1803 // Helper to report pcp errors.
1804 void _ReportPcpErrors(const PcpErrorVector &errors,
1805 const std::string &context) const;
1806 void _ReportErrors(const PcpErrorVector &errors,
1807 const std::vector<std::string>& otherErrors,
1808 const std::string &context) const;
1809
1810 // --------------------------------------------------------------------- //
1811 // Scenegraph Composition & Change Processing
1812 // --------------------------------------------------------------------- //
1813
1814 // Compose the prim indexes in the subtrees rooted at the paths in
1815 // \p primIndexPaths. If \p instanceChanges is given, returns
1816 // changes to prototypes and instances due to the discovery of new instances
1817 // during composition.
1818 void _ComposePrimIndexesInParallel(
1819 const std::vector<SdfPath>& primIndexPaths,
1820 const std::string& context,
1821 Usd_InstanceChanges* instanceChanges = nullptr);
1822
1823 // Recompose the subtree rooted at \p prim: compose its type, flags, and
1824 // list of children, then invoke _ComposeSubtree on all its children.
1825 void _ComposeSubtree(
1826 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1827 UsdStagePopulationMask const *mask,
1828 const SdfPath &primIndexPath = SdfPath());
1829 void _ComposeSubtreeImpl(
1830 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1831 UsdStagePopulationMask const *mask,
1832 const SdfPath &primIndexPath = SdfPath());
1833 void _ComposeSubtreesInParallel(
1834 const std::vector<Usd_PrimDataPtr> &prims,
1835 const std::vector<SdfPath> *primIndexPaths = nullptr);
1836
1837 // Composes the full prim type info for the prim based on its type name
1838 // and applied API schemas.
1839 void _ComposePrimTypeInfoImpl(Usd_PrimDataPtr prim);
1840
1841 // Compose subtree rooted at \p prim under \p parent. This function
1842 // ensures that the appropriate prim index is specified for \p prim if
1843 // \p parent is in a prototype.
1844 void _ComposeChildSubtree(Usd_PrimDataPtr prim,
1845 Usd_PrimDataConstPtr parent,
1846 UsdStagePopulationMask const *mask);
1847
1848 // Compose \p prim's list of children and make any modifications necessary
1849 // to its _children member and the stage's _primMap, including possibly
1850 // instantiating new prims, or destroying existing subtrees of prims. The
1851 // any newly created prims *do not* have their prim index, type, flags, or
1852 // children composed.
1853 //
1854 // Compose only \p prim's direct children if recurse=false. Otherwise
1855 // recompose every descendent of \p prim. Callers that pass recurse=false
1856 // should invoke _ComposeSubtree on any newly created prims to ensure caches
1857 // are correctly populated.
1858 void _ComposeChildren(Usd_PrimDataPtr prim,
1859 UsdStagePopulationMask const *mask, bool recurse);
1860
1861 // Instantiate a prim instance. There must not already be an instance
1862 // at \p primPath.
1863 Usd_PrimDataPtr _InstantiatePrim(const SdfPath &primPath);
1864
1865 // Instantiate a prototype prim and sets its parent to pseudoroot.
1866 // There must not already be a prototype at \p primPath.
1867 Usd_PrimDataPtr _InstantiatePrototypePrim(const SdfPath &primPath);
1868
1869 // For \p prim and all of its descendants, remove from _primMap and empty
1870 // their _children vectors.
1871 void _DestroyPrim(Usd_PrimDataPtr prim);
1872
1873 // Destroy the prim subtrees rooted at each path in \p paths. \p paths may
1874 // not contain any path that is a descendent of another path in \p paths.
1875 void _DestroyPrimsInParallel(const std::vector<SdfPath>& paths);
1876
1877 // Invoke _DestroyPrim() on all of \p prim's direct children.
1878 void _DestroyDescendents(Usd_PrimDataPtr prim);
1879
1880 // Returns true if the object at the given path is a descendant of
1881 // an instance prim, i.e. a prim beneath an instance prim, or a property
1882 // of a prim beneath an instance prim.
1883 bool _IsObjectDescendantOfInstance(const SdfPath& path) const;
1884
1885 // If the given prim is an instance, returns the corresponding
1886 // prototype prim. Otherwise, returns an invalid prim.
1887 Usd_PrimDataConstPtr _GetPrototypeForInstance(Usd_PrimDataConstPtr p) const;
1888
1889 // Returns the path of the Usd prim using the prim index at the given path.
1890 SdfPath _GetPrimPathUsingPrimIndexAtPath(const SdfPath& primIndexPath) const;
1891
1892 // Update stage contents in response to changes in scene description.
1893 void _HandleLayersDidChange(const SdfNotice::LayersDidChangeSentPerLayer &);
1894
1895 // Update stage contents in response to changes to the asset resolver.
1896 void _HandleResolverDidChange(const ArNotice::ResolverChanged &);
1897
1898 // Process stage change information stored in _pendingChanges.
1899 // _pendingChanges will be set to nullptr by the end of the function.
1900 void _ProcessPendingChanges();
1901
1902 // Remove scene description for the prim at \p fullPath in the current edit
1903 // target.
1904 bool _RemovePrim(const SdfPath& fullPath);
1905
1906 SdfPrimSpecHandle _GetPrimSpec(const SdfPath& fullPath);
1907
1908 // Find and return the defining spec type for the property spec at the given
1909 // path, or SdfSpecTypeUnknown if none exists. The defining spec type is
1910 // either the builtin definition's spec type, if the indicated property is
1911 // builtin, otherwise it's the strongest authored spec's type if one exists,
1912 // otherwise it's SdfSpecTypeUnknown.
1913 SdfSpecType _GetDefiningSpecType(Usd_PrimDataConstPtr primData,
1914 const TfToken &propName) const;
1915
1916 // Helper to apply Pcp changes and recompose the scenegraph accordingly,
1917 // given an optional initial set of paths to recompose.
1918 void _Recompose(const PcpChanges &changes);
1919 template <class T>
1920 void _Recompose(const PcpChanges &changes, T *pathsToRecompose);
1921 template <class T>
1922 void _RecomposePrims(T *pathsToRecompose);
1923
1924 // Helper for _Recompose to find the subtrees that need to be
1925 // fully recomposed and to recompose the name children of the
1926 // parents of these subtrees. Note that [start, finish) must be a
1927 // sorted range of map iterators whose keys are paths with no descendent
1928 // paths. In C++20, consider using the ranges API to improve this.
1929 template <class Iter>
1930 void _ComputeSubtreesToRecompose(Iter start, Iter finish,
1931 std::vector<Usd_PrimDataPtr>* recompose);
1932
1933 // return true if the path is valid for load/unload operations.
1934 // This method will emit errors when invalid paths are encountered.
1935 bool _IsValidForLoad(const SdfPath& path) const;
1936 bool _IsValidForUnload(const SdfPath& path) const;
1937
1938 // Discover all payloads in a given subtree, adding the path of each
1939 // discovered prim index to the \p primIndexPaths set. If specified,
1940 // the corresponding UsdPrim path will be added to the \p usdPrimPaths
1941 // set. The root path will be considered for inclusion in the result set.
1942 //
1943 // Note that some payloads may not be discoverable in until an ancestral
1944 // payload has been included. UsdStage::LoadAndUnload takes this into
1945 // account.
1946 void _DiscoverPayloads(const SdfPath& rootPath,
1947 UsdLoadPolicy policy,
1948 SdfPathSet* primIndexPaths,
1949 bool unloadedOnly = false,
1950 SdfPathSet* usdPrimPaths = nullptr) const;
1951
1952 // ===================================================================== //
1953 // VALUE RESOLUTION //
1954 // ===================================================================== //
1955 // --------------------------------------------------------------------- //
1956 // Specialized Value Resolution
1957 // --------------------------------------------------------------------- //
1958
1959 // Helpers for resolving values for metadata fields requiring
1960 // special behaviors.
1961 static SdfSpecifier _GetSpecifier(Usd_PrimDataConstPtr primData);
1962 static TfToken _GetKind(Usd_PrimDataConstPtr primData);
1963 static bool _IsActive(Usd_PrimDataConstPtr primData);
1964
1965 // Custom is true if it is true anywhere in the stack.
1966 bool _IsCustom(const UsdProperty &prop) const;
1967
1968 // Variability is determined by the weakest opinion in the stack.
1969 SdfVariability _GetVariability(const UsdProperty &prop) const;
1970
1971 // Helper functions for resolving asset paths during value resolution.
1972 void _MakeResolvedAssetPaths(UsdTimeCode time, const UsdAttribute &attr,
1973 SdfAssetPath *assetPaths,
1974 size_t numAssetPaths,
1975 bool anchorAssetPathsOnly = false) const;
1976
1977 void _MakeResolvedAssetPathsValue(UsdTimeCode time, const UsdAttribute &attr,
1978 VtValue *value,
1979 bool anchorAssetPathsOnly = false) const;
1980
1981 void _MakeResolvedTimeCodes(UsdTimeCode time, const UsdAttribute &attr,
1982 SdfTimeCode *timeCodes,
1983 size_t numTimeCodes) const;
1984
1985 void _MakeResolvedPathExpressions(
1986 UsdTimeCode time, const UsdAttribute &attr,
1987 SdfPathExpression *pathExprs,
1988 size_t numPathExprs) const;
1989
1990 void _MakeResolvedAttributeValue(UsdTimeCode time, const UsdAttribute &attr,
1991 VtValue *value) const;
1992
1993 // --------------------------------------------------------------------- //
1994 // Metadata Resolution
1995 // --------------------------------------------------------------------- //
1996
1997public:
1998 // Trait that allows us to call the correct version of _GetMetadata for
1999 // types that require type specific value resolution as opposed to just
2000 // strongest opinion. These types also use type specific resolution
2001 // in _GetValue.
2002 template <class T>
2003 struct _HasTypeSpecificResolution {
2004 static const bool value =
2005 std::is_same<T, SdfAssetPath>::value ||
2006 std::is_same<T, VtArray<SdfAssetPath>>::value ||
2007 std::is_same<T, SdfTimeCode>::value ||
2008 std::is_same<T, VtArray<SdfTimeCode>>::value ||
2009 std::is_same<T, SdfPathExpression>::value ||
2010 std::is_same<T, VtArray<SdfPathExpression>>::value ||
2011 std::is_same<T, SdfTimeSampleMap>::value ||
2012 std::is_same<T, VtDictionary>::value;
2013 };
2014
2015private:
2016 // Get metadata for types that do not 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 for types that do have type specific value resolution.
2026 template <class T>
2027 typename std::enable_if<_HasTypeSpecificResolution<T>::value, bool>::type
2028 _GetMetadata(const UsdObject &obj,
2029 const TfToken& fieldName,
2030 const TfToken &keyPath,
2031 bool useFallbacks,
2032 T* result) const;
2033
2034 // Get metadata as a dynamically typed VtValue. Will perform type specific
2035 // value resolution if the returned held type requires it.
2036 bool _GetMetadata(const UsdObject &obj,
2037 const TfToken& fieldName,
2038 const TfToken &keyPath,
2039 bool useFallbacks,
2040 VtValue* result) const;
2041
2042 // Gets a metadata value using only strongest value resolution. It is
2043 // assumed that result is holding a value that does not require type
2044 // specific value resolution.
2045 USD_API
2046 bool _GetStrongestResolvedMetadata(const UsdObject &obj,
2047 const TfToken& fieldName,
2048 const TfToken &keyPath,
2049 bool useFallbacks,
2050 SdfAbstractDataValue* result) const;
2051
2052 // Gets a metadata value with the type specific value resolution for the
2053 // type applied. This is only implemented for types that
2054 // _HasTypeSpecificResolution.
2055 template <class T>
2056 USD_API
2057 bool _GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2058 const TfToken& fieldName,
2059 const TfToken &keyPath,
2060 bool useFallbacks,
2061 T* result) const;
2062
2063 template <class Composer>
2064 void _GetAttrTypeImpl(const UsdAttribute &attr,
2065 const TfToken &fieldName,
2066 bool useFallbacks,
2067 Composer *composer) const;
2068
2069 template <class Composer>
2070 void _GetAttrVariabilityImpl(const UsdAttribute &attr,
2071 bool useFallbacks,
2072 Composer *composer) const;
2073
2074 template <class Composer>
2075 void _GetPropCustomImpl(const UsdProperty &prop,
2076 bool useFallbacks,
2077 Composer *composer) const;
2078
2079 template <class Composer>
2080 bool _GetSpecialPropMetadataImpl(const UsdObject &obj,
2081 const TfToken &fieldName,
2082 const TfToken &keyPath,
2083 bool useFallbacks,
2084 Composer *composer) const;
2085 template <class Composer>
2086 bool _GetMetadataImpl(const UsdObject &obj,
2087 const TfToken& fieldName,
2088 const TfToken& keyPath,
2089 bool includeFallbacks,
2090 Composer *composer) const;
2091
2092 template <class Composer>
2093 bool _GetGeneralMetadataImpl(const UsdObject &obj,
2094 const TfToken& fieldName,
2095 const TfToken& keyPath,
2096 bool includeFallbacks,
2097 Composer *composer) const;
2098
2099 // NOTE: The "authoredOnly" flag is not yet in use, but when we have
2100 // support for prim-based metadata fallbacks, they should be ignored when
2101 // this flag is set to true.
2102 bool _HasMetadata(const UsdObject &obj, const TfToken& fieldName,
2103 const TfToken &keyPath, bool useFallbacks) const;
2104
2106 _ListMetadataFields(const UsdObject &obj, bool useFallbacks) const;
2107
2108 void _GetAllMetadata(const UsdObject &obj,
2109 bool useFallbacks,
2110 UsdMetadataValueMap* result,
2111 bool anchorAssetPathsOnly = false) const;
2112
2113 // --------------------------------------------------------------------- //
2114 // Default & TimeSample Resolution
2115 // --------------------------------------------------------------------- //
2116
2117 void _GetResolveInfo(const UsdAttribute &attr,
2118 UsdResolveInfo *resolveInfo,
2119 const UsdTimeCode *time = nullptr) const;
2120
2121 void _GetResolveInfoWithResolveTarget(
2122 const UsdAttribute &attr,
2123 const UsdResolveTarget &resolveTarget,
2124 UsdResolveInfo *resolveInfo,
2125 const UsdTimeCode *time = nullptr) const;
2126
2127 template <class T> struct _ExtraResolveInfo;
2128
2129 // Gets the value resolve info for the given attribute. If time is provided,
2130 // the resolve info is evaluated for that specific time (which may be
2131 // default). Otherwise, if time is null, the resolve info is evaluated for
2132 // "any numeric time" and will not populate values in extraInfo that
2133 // require a specific time to be evaluated.
2134 template <class T>
2135 void _GetResolveInfo(const UsdAttribute &attr,
2136 UsdResolveInfo *resolveInfo,
2137 const UsdTimeCode *time = nullptr,
2138 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2139
2140 // Gets the value resolve info for the given attribute using the given
2141 // resolve target. If time is provided, the resolve info is evaluated for
2142 // that specific time (which may be default). Otherwise, if time is null,
2143 // the resolve info is evaluated for "any numeric time" and will not
2144 // populate values in extraInfo that require a specific time to be
2145 // evaluated.
2146 template <class T>
2147 void _GetResolveInfoWithResolveTarget(
2148 const UsdAttribute &attr,
2149 const UsdResolveTarget &resolveTarget,
2150 UsdResolveInfo *resolveInfo,
2151 const UsdTimeCode *time = nullptr,
2152 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2153
2154 // Shared implementation function for _GetResolveInfo and
2155 // _GetResolveInfoWithResolveTarget. The only difference between how these
2156 // two functions behave is in how they create the Usd_Resolver used for
2157 // iterating over nodes and layers, thus they provide this implementation
2158 // with the needed MakeUsdResolverFn to create the Usd_Resolver.
2159 template <class T, class MakeUsdResolverFn>
2160 void _GetResolveInfoImpl(const UsdAttribute &attr,
2161 UsdResolveInfo *resolveInfo,
2162 const UsdTimeCode *time,
2163 _ExtraResolveInfo<T> *extraInfo,
2164 const MakeUsdResolverFn &makeUsdResolveFn) const;
2165
2166 template <class T> struct _ResolveInfoResolver;
2167 struct _PropertyStackResolver;
2168
2169 template <class Resolver, class MakeUsdResolverFn>
2170 void _GetResolvedValueAtDefaultImpl(
2171 const UsdProperty &prop,
2172 Resolver *resolver,
2173 const MakeUsdResolverFn &makeUsdResolverFn) const;
2174
2175 template <class Resolver, class MakeUsdResolverFn>
2176 void _GetResolvedValueAtTimeImpl(
2177 const UsdProperty &prop,
2178 Resolver *resolver,
2179 const double *time,
2180 const MakeUsdResolverFn &makeUsdResolverFn) const;
2181
2182 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2183 VtValue* result) const;
2184
2185 template <class T>
2186 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2187 T* result) const;
2188
2189 template <class T>
2190 bool _GetValueImpl(UsdTimeCode time, const UsdAttribute &attr,
2191 Usd_InterpolatorBase* interpolator,
2192 T* value) const;
2193
2194 USD_API
2195 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2196 UsdTimeCode time, const UsdAttribute &attr,
2197 VtValue* result) const;
2198
2199 template <class T>
2200 USD_API
2201 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2202 UsdTimeCode time, const UsdAttribute &attr,
2203 T* result) const;
2204
2205 template <class T>
2206 bool _GetValueFromResolveInfoImpl(const UsdResolveInfo &info,
2207 UsdTimeCode time, const UsdAttribute &attr,
2208 Usd_InterpolatorBase* interpolator,
2209 T* value) const;
2210
2211 template <class T>
2212 bool _GetDefaultValueFromResolveInfoImpl(const UsdResolveInfo &info,
2213 const UsdAttribute &attr,
2214 T* value) const;
2215
2216 Usd_AssetPathContext
2217 _GetAssetPathContext(UsdTimeCode time, const UsdAttribute &attr) const;
2218
2219 // --------------------------------------------------------------------- //
2220 // Specialized Time Sample I/O
2221 // --------------------------------------------------------------------- //
2222
2229 bool _GetTimeSamplesInInterval(const UsdAttribute &attr,
2230 const GfInterval& interval,
2231 std::vector<double>* times) const;
2232
2233 bool _GetTimeSamplesInIntervalFromResolveInfo(
2234 const UsdResolveInfo &info,
2235 const UsdAttribute &attr,
2236 const GfInterval& interval,
2237 std::vector<double>* times) const;
2238
2239 size_t _GetNumTimeSamples(const UsdAttribute &attr) const;
2240
2241 size_t _GetNumTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2242 const UsdAttribute &attr) const;
2243
2247 bool _GetBracketingTimeSamples(const UsdAttribute &attr,
2248 double desiredTime,
2249 bool authoredOnly,
2250 double* lower,
2251 double* upper,
2252 bool* hasSamples) const;
2253
2254 bool _GetBracketingTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2255 const UsdAttribute &attr,
2256 double desiredTime,
2257 bool authoredOnly,
2258 double* lower,
2259 double* upper,
2260 bool* hasSamples) const;
2261
2262 bool _ValueMightBeTimeVarying(const UsdAttribute &attr) const;
2263
2264 bool _ValueMightBeTimeVaryingFromResolveInfo(const UsdResolveInfo &info,
2265 const UsdAttribute &attr) const;
2266
2267 void _RegisterPerLayerNotices();
2268 void _RegisterResolverChangeNotice();
2269
2270 // Helper to obtain a malloc tag string for this stage.
2271 inline char const *_GetMallocTagId() const;
2272
2273private:
2274
2275 // The 'pseudo root' prim.
2276 Usd_PrimDataPtr _pseudoRoot;
2277
2278 // The stage's root layer.
2279 SdfLayerRefPtr _rootLayer;
2280
2281 // Every UsdStage has an implicit, in-memory session layer.
2282 // This is to allow for runtime overrides such as variant selections.
2283 SdfLayerRefPtr _sessionLayer;
2284
2285 // The stage's EditTarget.
2286 UsdEditTarget _editTarget;
2287 bool _editTargetIsLocalLayer;
2288
2289 std::unique_ptr<PcpCache> _cache;
2290 std::unique_ptr<Usd_ClipCache> _clipCache;
2291 std::unique_ptr<Usd_InstanceCache> _instanceCache;
2292
2293 TfHashMap<TfToken, TfToken, TfHash> _invalidPrimTypeToFallbackMap;
2294
2295 size_t _usedLayersRevision;
2296
2297 // A concurrent map from Path to Prim, for fast random access.
2298 struct _TbbHashEq {
2299 inline bool equal(SdfPath const &l, SdfPath const &r) const {
2300 return l == r;
2301 }
2302 inline size_t hash(SdfPath const &path) const {
2303 return path.GetHash();
2304 }
2305 };
2306 using PathToNodeMap = tbb::concurrent_hash_map<
2307 SdfPath, Usd_PrimDataIPtr, _TbbHashEq>;
2308 PathToNodeMap _primMap;
2309
2310 // The interpolation type used for all attributes on the stage.
2311 UsdInterpolationType _interpolationType;
2312
2313 typedef std::vector<
2314 std::pair<SdfLayerHandle, TfNotice::Key> > _LayerAndNoticeKeyVec;
2315 _LayerAndNoticeKeyVec _layersAndNoticeKeys;
2316 size_t _lastChangeSerialNumber;
2317
2318 TfNotice::Key _resolverChangeKey;
2319
2320 // Data for pending change processing.
2321 class _PendingChanges;
2322 _PendingChanges* _pendingChanges;
2323
2324 boost::optional<WorkDispatcher> _dispatcher;
2325
2326 // To provide useful aggregation of malloc stats, we bill everything
2327 // for this stage - from all access points - to this tag.
2328 std::unique_ptr<std::string> _mallocTagID;
2329
2330 // The state used when instantiating the stage.
2331 const InitialLoadSet _initialLoadSet;
2332
2333 // The population mask that applies to this stage.
2334 UsdStagePopulationMask _populationMask;
2335
2336 // The load rules that apply to this stage.
2337 UsdStageLoadRules _loadRules;
2338
2339 bool _isClosingStage;
2340 bool _isWritingFallbackPrimTypes;
2341
2342 friend class UsdAPISchemaBase;
2343 friend class UsdAttribute;
2344 friend class UsdAttributeQuery;
2345 friend class UsdEditTarget;
2346 friend class UsdInherits;
2347 friend class UsdObject;
2348 friend class UsdPrim;
2349 friend class UsdProperty;
2350 friend class UsdRelationship;
2351 friend class UsdSpecializes;
2352 friend class UsdVariantSet;
2353 friend class UsdVariantSets;
2354 friend class Usd_AssetPathContext;
2355 friend class Usd_FlattenAccess;
2356 friend class Usd_PcpCacheAccess;
2357 friend class Usd_PrimData;
2358 friend class Usd_StageOpenRequest;
2359 template <class T> friend struct Usd_AttrGetValueHelper;
2360 friend struct Usd_AttrGetUntypedValueHelper;
2361 template <class RefsOrPayloadsEditorType, class RefsOrPayloadsProxyType>
2362 friend struct Usd_ListEditImpl;
2363};
2364
2365// UsdObject's typed metadata query relies on this specialization being
2366// externally visible and exporting the primary template does not
2367// automatically export this specialization.
2368template <>
2369USD_API
2370bool
2371UsdStage::_GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2372 const TfToken& fieldName,
2373 const TfToken &keyPath,
2374 bool useFallbacks,
2375 SdfTimeSampleMap* result) const;
2376
2377template<typename T>
2378bool
2379UsdStage::GetMetadata(const TfToken& key, T* value) const
2380{
2381 VtValue result;
2382 if (!GetMetadata(key, &result)){
2383 return false;
2384 }
2385
2386 if (result.IsHolding<T>()){
2387 *value = result.UncheckedGet<T>();
2388 return true;
2389 } else {
2390 TF_CODING_ERROR("Requested type %s for stage metadatum %s does not"
2391 " match retrieved type %s",
2392 ArchGetDemangled<T>().c_str(),
2393 key.GetText(),
2394 result.GetTypeName().c_str());
2395 return false;
2396 }
2397}
2398
2399template<typename T>
2400bool
2401UsdStage::SetMetadata(const TfToken& key, const T& value) const
2402{
2403 VtValue in(value);
2404 return SetMetadata(key, in);
2405}
2406
2407template<typename T>
2408bool
2410 T* value) const
2411{
2412 VtValue result;
2413 if (!GetMetadataByDictKey(key, keyPath, &result)){
2414 return false;
2415 }
2416
2417 if (result.IsHolding<T>()){
2418 *value = result.UncheckedGet<T>();
2419 return true;
2420 } else {
2421 TF_CODING_ERROR("Requested type %s for stage metadatum %s[%s] does not"
2422 " match retrieved type %s",
2423 ArchGetDemangled<T>().c_str(),
2424 key.GetText(),
2425 keyPath.GetText(),
2426 result.GetTypeName().c_str());
2427 return false;
2428 }
2429}
2430
2431template<typename T>
2432bool
2434 const T& value) const
2435{
2436 VtValue in(value);
2437 return SetMetadataByDictKey(key, keyPath, in);
2438}
2439
2440// Get metadata for types that do not have type specific value resolution.
2441template <class T>
2442typename std::enable_if<
2443 !UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2444UsdStage::_GetMetadata(const UsdObject &obj,
2445 const TfToken& fieldName,
2446 const TfToken &keyPath,
2447 bool useFallbacks,
2448 T* result) const
2449{
2450 // Since these types don't have type specific value resolution, we can just
2451 // get the strongest metadata value and be done.
2452 SdfAbstractDataTypedValue<T> out(result);
2453 return _GetStrongestResolvedMetadata(
2454 obj, fieldName, keyPath, useFallbacks, &out);
2455}
2456
2457// Get metadata for types that do have type specific value resolution.
2458template <class T>
2459typename std::enable_if<
2460 UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2461UsdStage::_GetMetadata(const UsdObject &obj,
2462 const TfToken& fieldName,
2463 const TfToken &keyPath,
2464 bool useFallbacks,
2465 T* result) const
2466{
2467 // Call the templated type specifice resolved metadata implementation that
2468 // will only be implemented for types that support it.
2469 return _GetTypeSpecificResolvedMetadata(
2470 obj, fieldName, keyPath, useFallbacks, result);
2471}
2472
2473
2474// Set metadata for types that don't need to be mapped across edit targets.
2475template <class T>
2476typename std::enable_if<!UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2477UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2478 const TfToken &keyPath, const T& value)
2479{
2480 // Since we know that we don't need to map the value for edit targets,
2481 // we can just type erase the value and set the metadata as is.
2483 return _SetMetadataImpl<SdfAbstractDataConstValue>(
2484 object, key, keyPath, in);
2485}
2486
2487// Set metadata for types that do need to be mapped for edit targets.
2488template <class T>
2489typename std::enable_if<UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2490UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2491 const TfToken &keyPath, const T& value)
2492{
2493 return _SetEditTargetMappedMetadata(object, key, keyPath, value);
2494}
2495
2496PXR_NAMESPACE_CLOSE_SCOPE
2497
2498#endif //PXR_USD_USD_STAGE_H
2499
Notice sent when asset paths may resolve to a different path than before due to a change in the resol...
Definition: notice.h:67
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:50
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:94
Describes Pcp changes.
Definition: changes.h:191
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
Definition: primIndex.h:78
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:562
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:467
A type-erased container for a field value in an SdfAbstractData.
Definition: abstractData.h:416
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
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:97
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
Definition: layer.h:120
Notice sent per-layer indicating all layers whose contents have changed within a single round of chan...
Definition: notice.h:111
Objects of this class represent a logical expression syntax tree consisting of SdfPath matching patte...
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:291
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:45
Handle-object returned by TfNotice::Register().
Definition: notice.h:256
Enable a concrete base class for use with TfRefPtr.
Definition: refBase.h:71
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
char const * GetText() const
Return the text that this token represents.
Definition: token.h:196
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:141
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
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:79
A proxy class for applying listOp edits to the inherit paths list for a prim.
Definition: inherits.h:51
Base class for Usd scenegraph objects, providing common API.
Definition: object.h:132
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:134
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
Definition: primRange.h:119
Base class for UsdAttribute and UsdRelationship scenegraph objects.
Definition: property.h:55
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:128
Container for information about the source of an attribute's value, i.e.
Definition: resolveInfo.h:69
Defines a subrange of nodes and layers within a prim's prim index to consider when performing value r...
Definition: resolveTarget.h:73
A proxy class for applying listOp edits to the specializes list for a prim.
Definition: specializes.h:51
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
Definition: stage.h:152
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:2401
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.
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)
Expand this stage's population mask to include the targets of all relationships that pass relPred and...
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:671
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 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 root UsdPrim on this stage whose name 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:166
@ LoadAll
Load all loadable prims.
Definition: stage.h:167
@ LoadNone
Load no loadable prims.
Definition: stage.h:168
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:2433
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
Return this stage's local layers in strong-to-weak order.
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:2409
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:2379
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:654
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:84
A UsdVariantSet represents a single VariantSet in USD (e.g.
Definition: variantSets.h:56
UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim.
Definition: variantSets.h:222
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
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:1082
T const & UncheckedGet() const &
Returns a const reference to the held object if the held object is of type T.
Definition: value.h:1122
UsdLoadPolicy
Controls UsdStage::Load() and UsdPrim::Load() behavior regarding whether or not descendant prims are ...
Definition: common.h:116
@ UsdLoadWithDescendants
Load a prim plus all its descendants.
Definition: common.h:118
Standard pointer typedefs.
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
Definition: diagnostic.h:85
UsdInterpolationType
Attribute value interpolation options.
Definition: interpolation.h:47
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
Definition: types.h:206
Basic Sdf data types.
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:85
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
Definition: types.h:117
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:173
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:281