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 <tbb/concurrent_vector.h>
55#include <tbb/concurrent_unordered_set.h>
56#include <tbb/concurrent_hash_map.h>
57#include <tbb/spin_rw_mutex.h>
58
59#include <functional>
60#include <string>
61#include <memory>
62#include <optional>
63#include <unordered_map>
64#include <utility>
65
66PXR_NAMESPACE_OPEN_SCOPE
67
69class GfInterval;
71class Usd_AssetPathContext;
72class Usd_ClipCache;
73class Usd_InstanceCache;
74class Usd_InstanceChanges;
75class Usd_InterpolatorBase;
76class Usd_Resolver;
77class UsdResolveInfo;
79class UsdPrim;
80class UsdPrimRange;
81
82SDF_DECLARE_HANDLES(SdfLayer);
83
151class UsdStage : public TfRefBase, public TfWeakBase {
152public:
153
154 // --------------------------------------------------------------------- //
158 // --------------------------------------------------------------------- //
159
165 {
167 LoadNone
168 };
169
180 //
192 USD_API
193 static UsdStageRefPtr
194 CreateNew(const std::string& identifier,
195 InitialLoadSet load = LoadAll);
197 USD_API
198 static UsdStageRefPtr
199 CreateNew(const std::string& identifier,
200 const SdfLayerHandle& sessionLayer,
201 InitialLoadSet load = LoadAll);
203 USD_API
204 static UsdStageRefPtr
205 CreateNew(const std::string& identifier,
206 const SdfLayerHandle& sessionLayer,
207 const ArResolverContext& pathResolverContext,
208 InitialLoadSet load = LoadAll);
210 USD_API
211 static UsdStageRefPtr
212 CreateNew(const std::string& identifier,
213 const ArResolverContext& pathResolverContext,
214 InitialLoadSet load = LoadAll);
215
233 USD_API
234 static UsdStageRefPtr
237 USD_API
238 static UsdStageRefPtr
239 CreateInMemory(const std::string& identifier,
240 InitialLoadSet load = LoadAll);
242 USD_API
243 static UsdStageRefPtr
244 CreateInMemory(const std::string& identifier,
245 const ArResolverContext& pathResolverContext,
246 InitialLoadSet load = LoadAll);
248 USD_API
249 static UsdStageRefPtr
250 CreateInMemory(const std::string& identifier,
251 const SdfLayerHandle &sessionLayer,
252 InitialLoadSet load = LoadAll);
254 USD_API
255 static UsdStageRefPtr
256 CreateInMemory(const std::string& identifier,
257 const SdfLayerHandle &sessionLayer,
258 const ArResolverContext& pathResolverContext,
259 InitialLoadSet load = LoadAll);
260
276 USD_API
277 static UsdStageRefPtr
278 Open(const std::string& filePath, InitialLoadSet load = LoadAll);
280 USD_API
281 static UsdStageRefPtr
282 Open(const std::string& filePath,
283 const ArResolverContext& pathResolverContext,
284 InitialLoadSet load = LoadAll);
285
303 USD_API
304 static UsdStageRefPtr
305 OpenMasked(const std::string &filePath,
306 UsdStagePopulationMask const &mask,
307 InitialLoadSet load = LoadAll);
309 USD_API
310 static UsdStageRefPtr
311 OpenMasked(const std::string &filePath,
312 const ArResolverContext &pathResolverContext,
313 UsdStagePopulationMask const &mask,
314 InitialLoadSet load = LoadAll);
315
344 USD_API
345 static UsdStageRefPtr
346 Open(const SdfLayerHandle& rootLayer,
349 USD_API
350 static UsdStageRefPtr
351 Open(const SdfLayerHandle& rootLayer,
352 const SdfLayerHandle& sessionLayer,
355 USD_API
356 static UsdStageRefPtr
357 Open(const SdfLayerHandle& rootLayer,
358 const ArResolverContext& pathResolverContext,
361 USD_API
362 static UsdStageRefPtr
363 Open(const SdfLayerHandle& rootLayer,
364 const SdfLayerHandle& sessionLayer,
365 const ArResolverContext& pathResolverContext,
367
388 USD_API
389 static UsdStageRefPtr
390 OpenMasked(const SdfLayerHandle& rootLayer,
391 const UsdStagePopulationMask &mask,
394 USD_API
395 static UsdStageRefPtr
396 OpenMasked(const SdfLayerHandle& rootLayer,
397 const SdfLayerHandle& sessionLayer,
398 const UsdStagePopulationMask &mask,
401 USD_API
402 static UsdStageRefPtr
403 OpenMasked(const SdfLayerHandle& rootLayer,
404 const ArResolverContext& pathResolverContext,
405 const UsdStagePopulationMask &mask,
408 USD_API
409 static UsdStageRefPtr
410 OpenMasked(const SdfLayerHandle& rootLayer,
411 const SdfLayerHandle& sessionLayer,
412 const ArResolverContext& pathResolverContext,
413 const UsdStagePopulationMask &mask,
415
416 USD_API
417 virtual ~UsdStage();
418
436 USD_API
437 void Reload();
438
447 USD_API
448 static bool
449 IsSupportedFile(const std::string& filePath);
450
452
453 // --------------------------------------------------------------------- //
462
470 USD_API
471 void Save();
472
480 USD_API
482
484
485 // --------------------------------------------------------------------- //
531
533 USD_API
535
541 USD_API
542 static void
544
546
547 // --------------------------------------------------------------------- //
576 // --------------------------------------------------------------------- //
577
585 USD_API
588
594 USD_API
596
608 USD_API
609 void LoadAndUnload(const SdfPathSet &loadSet, const SdfPathSet &unloadSet,
611
622 USD_API
623 SdfPathSet GetLoadSet();
624
644 USD_API
645 SdfPathSet FindLoadable(
646 const SdfPath& rootPath = SdfPath::AbsoluteRootPath());
647
654 return _loadRules;
655 }
656
666 USD_API
667 void SetLoadRules(UsdStageLoadRules const &rules);
668
671 return _populationMask;
672 }
673
675 USD_API
677
691 USD_API
693 Usd_PrimFlagsPredicate const &traversalPredicate,
694 std::function<bool (UsdRelationship const &)> const &relPred = nullptr,
695 std::function<bool (UsdAttribute const &)> const &attrPred = nullptr);
696
700 USD_API
702 std::function<bool (UsdRelationship const &)> const &relPred = nullptr,
703 std::function<bool (UsdAttribute const &)> const &attrPred = nullptr);
704
706
707 // --------------------------------------------------------------------- //
716 // --------------------------------------------------------------------- //
717
727 USD_API
729
736 USD_API
738
746 USD_API
747 void SetDefaultPrim(const UsdPrim &prim);
748
756 USD_API
758
766 USD_API
767 bool HasDefaultPrim() const;
768
778 USD_API
779 UsdPrim GetPrimAtPath(const SdfPath &path) const;
780
805 USD_API
807
816 USD_API
818
827 USD_API
829
838 USD_API
840private:
841 // Return the primData object at \p path.
842 Usd_PrimDataConstPtr _GetPrimDataAtPath(const SdfPath &path) const;
843 Usd_PrimDataPtr _GetPrimDataAtPath(const SdfPath &path);
844
845 // Return the primData object at \p path. If \p path indicates a prim
846 // beneath an instance, return the primData object for the corresponding
847 // prim in the instance's prototype.
848 Usd_PrimDataConstPtr
849 _GetPrimDataAtPathOrInPrototype(const SdfPath &path) const;
850
852 std::vector<UsdPrim>
853 _GetInstancesForPrototype(const UsdPrim& prototype) const;
854
855public:
856
877 USD_API
879
884 USD_API
885 UsdPrimRange Traverse(const Usd_PrimFlagsPredicate &predicate);
886
891 USD_API
893
912 USD_API
914
938 USD_API
940 const TfToken &typeName=TfToken());
941
954 USD_API
955 UsdPrim CreateClassPrim(const SdfPath &rootPrimPath);
956
978 USD_API
979 bool RemovePrim(const SdfPath& path);
980
982
983 // --------------------------------------------------------------------- //
987 // --------------------------------------------------------------------- //
988
990 USD_API
991 SdfLayerHandle GetSessionLayer() const;
992
994 USD_API
995 SdfLayerHandle GetRootLayer() const;
996
1001 USD_API
1003
1013 USD_API
1014 std::string
1015 ResolveIdentifierToEditTarget(std::string const &identifier) const;
1016
1023 USD_API
1024 SdfLayerHandleVector GetLayerStack(bool includeSessionLayers=true) const;
1025
1037 USD_API
1038 SdfLayerHandleVector GetUsedLayers(bool includeClipLayers=true) const;
1039
1042 USD_API
1043 bool HasLocalLayer(const SdfLayerHandle &layer) const;
1044
1046 USD_API
1048
1052 USD_API
1054
1058 USD_API
1059 UsdEditTarget GetEditTargetForLocalLayer(const SdfLayerHandle &layer);
1060
1067 USD_API
1068 void SetEditTarget(const UsdEditTarget &editTarget);
1069
1096 USD_API
1097 void MuteLayer(const std::string &layerIdentifier);
1098
1101 USD_API
1102 void UnmuteLayer(const std::string &layerIdentifier);
1103
1111 USD_API
1112 void MuteAndUnmuteLayers(const std::vector<std::string> &muteLayers,
1113 const std::vector<std::string> &unmuteLayers);
1114
1116 USD_API
1117 const std::vector<std::string>& GetMutedLayers() const;
1118
1123 USD_API
1124 bool IsLayerMuted(const std::string& layerIdentifier) const;
1125
1127
1128 // --------------------------------------------------------------------- //
1132 // --------------------------------------------------------------------- //
1133 // Future Work:
1134 // * Flatten sub-trees or individual prims
1135 // * Allow flattening of local LayerStack
1136 // * Move Flatten into a free-function to ensure it doesn't rely on
1137 // Stage internals.
1138
1146 USD_API
1147 bool Export(const std::string &filename,
1148 bool addSourceFileComment=true,
1149 const SdfLayer::FileFormatArguments &args =
1151
1159 USD_API
1160 bool ExportToString(std::string *result,
1161 bool addSourceFileComment=true) const;
1162
1189 USD_API
1190 SdfLayerRefPtr Flatten(bool addSourceFileComment=true) const;
1192
1193public:
1194 // --------------------------------------------------------------------- //
1202 // --------------------------------------------------------------------- //
1203
1215 template <class T>
1216 bool GetMetadata(const TfToken &key, T *value) const;
1218 USD_API
1219 bool GetMetadata(const TfToken &key, VtValue *value) const;
1220
1227 USD_API
1228 bool HasMetadata(const TfToken &key) const;
1229
1238 USD_API
1239 bool HasAuthoredMetadata(const TfToken &key) const;
1240
1249 template<typename T>
1250 bool SetMetadata(const TfToken &key, const T &value) const;
1252 USD_API
1253 bool SetMetadata(const TfToken &key, const VtValue &value) const;
1254
1263 USD_API
1264 bool ClearMetadata(const TfToken &key) const;
1265
1281 template<typename T>
1282 bool GetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1283 T* value) const;
1285 USD_API
1287 const TfToken& key, const TfToken &keyPath, VtValue *value) const;
1288
1299 USD_API
1301 const TfToken& key, const TfToken &keyPath) const;
1302
1311 USD_API
1313 const TfToken& key, const TfToken &keyPath) const;
1314
1326 template<typename T>
1327 bool SetMetadataByDictKey(const TfToken& key, const TfToken &keyPath,
1328 const T& value) const;
1330 USD_API
1332 const TfToken& key, const TfToken &keyPath, const VtValue& value) const;
1333
1345 USD_API
1347 const TfToken& key, const TfToken& keyPath) const;
1348
1367 USD_API
1369
1371
1372 // --------------------------------------------------------------------- //
1379 // --------------------------------------------------------------------- //
1383 USD_API
1384 double GetStartTimeCode() const;
1385
1392 USD_API
1393 void SetStartTimeCode(double);
1394
1398 USD_API
1399 double GetEndTimeCode() const;
1400
1407 USD_API
1408 void SetEndTimeCode(double);
1409
1412 USD_API
1414
1430 USD_API
1432
1441 USD_API
1442 void SetTimeCodesPerSecond(double timeCodesPerSecond) const;
1443
1453 USD_API
1454 double GetFramesPerSecond() const;
1455
1464 USD_API
1465 void SetFramesPerSecond(double framesPerSecond) const;
1466
1468
1469 // --------------------------------------------------------------------- //
1515 // --------------------------------------------------------------------- //
1516
1522 USD_API
1523 void SetColorConfiguration(const SdfAssetPath &colorConfig) const;
1524
1529 USD_API
1531
1536 USD_API
1537 void SetColorManagementSystem(const TfToken &cms) const;
1538
1543 USD_API
1545
1557 USD_API
1558 static void GetColorConfigFallbacks(SdfAssetPath *colorConfiguration,
1559 TfToken *colorManagementSystem);
1560
1574 USD_API
1575 static void
1576 SetColorConfigFallbacks(const SdfAssetPath &colorConfiguration,
1577 const TfToken &colorManagementSystem);
1578
1580
1581 // --------------------------------------------------------------------- //
1588 // --------------------------------------------------------------------- //
1589
1594 USD_API
1596
1599 USD_API
1601
1603
1604 // --------------------------------------------------------------------- //
1609 // --------------------------------------------------------------------- //
1610
1612 USD_API
1613 std::vector<UsdPrim> GetPrototypes() const;
1614
1616
1617private:
1618 struct _IncludePayloadsPredicate;
1619
1620 // --------------------------------------------------------------------- //
1621 // Stage Construction & Initialization
1622 // --------------------------------------------------------------------- //
1623
1624 UsdStage(const SdfLayerRefPtr& rootLayer,
1625 const SdfLayerRefPtr& sessionLayer,
1626 const ArResolverContext& pathResolverContext,
1627 const UsdStagePopulationMask& mask,
1628 InitialLoadSet load);
1629
1630 // Helper for Open() overloads -- searches and publishes to bound caches.
1631 template <class... Args>
1632 static UsdStageRefPtr _OpenImpl(InitialLoadSet load, Args const &... args);
1633
1634 // Releases resources used by this stage.
1635 void _Close();
1636
1637 // Common ref ptr initialization, called by public, static constructors.
1638 //
1639 // This method will either return a valid refptr (if the stage is correctly
1640 // initialized) or it will return a null ref pointer, deleting the
1641 // raw stage pointer in the process.
1642 static UsdStageRefPtr
1643 _InstantiateStage(const SdfLayerRefPtr &rootLayer,
1644 const SdfLayerRefPtr &sessionLayer,
1645 const ArResolverContext &pathResolverContext,
1646 const UsdStagePopulationMask &mask,
1647 InitialLoadSet load);
1648
1649 // --------------------------------------------------------------------- //
1650 // Spec Existence & Definition Helpers
1651 // --------------------------------------------------------------------- //
1652
1653 SdfPropertySpecHandleVector
1654 _GetPropertyStack(const UsdProperty &prop, UsdTimeCode time) const;
1655
1656 std::vector<std::pair<SdfPropertySpecHandle, SdfLayerOffset>>
1657 _GetPropertyStackWithLayerOffsets(
1658 const UsdProperty &prop, UsdTimeCode time) const;
1659
1660 static SdfPrimSpecHandleVector
1661 _GetPrimStack(const UsdPrim &prim);
1662
1663 static std::vector<std::pair<SdfPrimSpecHandle, SdfLayerOffset>>
1664 _GetPrimStackWithLayerOffsets(const UsdPrim &prim);
1665
1667 _GetSchemaProperty(const UsdProperty &prop) const;
1668
1670 _GetSchemaAttribute(const UsdAttribute &attr) const;
1671
1673 _GetSchemaRelationship(const UsdRelationship &rel) const;
1674
1675 SdfAttributeSpecHandle
1676 _CreateNewSpecFromSchemaAttribute(
1677 const UsdPrim &prim,
1678 const UsdPrimDefinition::Attribute &attrDef);
1679
1680 SdfRelationshipSpecHandle
1681 _CreateNewSpecFromSchemaRelationship(
1682 const UsdPrim &prim,
1683 const UsdPrimDefinition::Relationship &relDef);
1684
1685 template <class PropType>
1687 _CreateNewPropertySpecFromSchema(const UsdProperty &prop);
1688
1689 SdfPrimSpecHandle
1690 _CreatePrimSpecForEditing(const UsdPrim& prim);
1691
1692 template <class PropType>
1694 _CreatePropertySpecForEditing(const UsdProperty &prop);
1695
1696 SdfPropertySpecHandle
1697 _CreatePropertySpecForEditing(const UsdProperty &prop);
1698
1699 SdfAttributeSpecHandle
1700 _CreateAttributeSpecForEditing(const UsdAttribute &attr);
1701
1702 SdfRelationshipSpecHandle
1703 _CreateRelationshipSpecForEditing(const UsdRelationship &rel);
1704
1705 // Check if the given path is valid to use with the prim creation API,
1706 // like DefinePrim. If it is valid, returns (true, GetPrimAtPath(path)).
1707 // Otherwise, returns (false, UsdPrim()).
1708 std::pair<bool, UsdPrim>
1709 _IsValidPathForCreatingPrim(const SdfPath &path) const;
1710
1711 // Validates that editing a specified prim is allowed. If editing is not
1712 // allowed, issues a coding error like "Cannot <operation> ..." and
1713 // returns false. Otherwise, returns true.
1714 bool _ValidateEditPrim(const UsdPrim &prim, const char* operation) const;
1715 bool _ValidateEditPrimAtPath(const SdfPath &primPath,
1716 const char* operation) const;
1717
1718 UsdPrim _DefinePrim(const SdfPath &path, const TfToken &typeName);
1719
1720 bool _RemoveProperty(const SdfPath& path);
1721
1722 UsdProperty _FlattenProperty(const UsdProperty &srcProp,
1723 const UsdPrim &dstParent,
1724 const TfToken &dstName);
1725
1726 // --------------------------------------------------------------------- //
1727 // Value & Metadata Authoring
1728 // --------------------------------------------------------------------- //
1729
1730 // Trait that allows us to call the correct versions of _SetValue and
1731 // _SetMetadata for types whose values need to be mapped when written to
1732 // different edit targets.
1733 template <class T>
1734 struct _IsEditTargetMappable {
1735 static const bool value =
1736 std::is_same<T, SdfTimeCode>::value ||
1737 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1738 std::is_same<T, SdfPathExpression>::value ||
1739 std::is_same<T, VtArray<SdfPathExpression>>::value ||
1740 std::is_same<T, SdfTimeSampleMap>::value ||
1741 std::is_same<T, VtDictionary>::value;
1742 };
1743
1744 // Set value for types that don't need to be mapped for edit targets.
1745 template <class T>
1746 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1747 _SetValue(
1748 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1749
1750 // Set value for types that do need to be mapped for edit targets.
1751 template <class T>
1752 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1753 _SetValue(
1754 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1755
1756 // Set value for dynamically typed VtValue. Will map the value across edit
1757 // targets if the held value type supports it.
1758 bool _SetValue(
1759 UsdTimeCode time, const UsdAttribute &attr, const VtValue &newValue);
1760
1761 template <class T>
1762 bool _SetEditTargetMappedValue(
1763 UsdTimeCode time, const UsdAttribute &attr, const T &newValue);
1764
1765 template <class T>
1766 bool _SetValueImpl(
1767 UsdTimeCode time, const UsdAttribute &attr, const T& value);
1768
1769 bool _ClearValue(UsdTimeCode time, const UsdAttribute &attr);
1770
1771 // Set metadata for types that don't need to be mapped across edit targets.
1772 template <class T>
1773 typename std::enable_if<!_IsEditTargetMappable<T>::value, bool>::type
1774 _SetMetadata(const UsdObject &object, const TfToken& key,
1775 const TfToken &keyPath, const T& value);
1776
1777 // Set metadata for types that do need to be mapped for edit targets.
1778 template <class T>
1779 typename std::enable_if<_IsEditTargetMappable<T>::value, bool>::type
1780 _SetMetadata(const UsdObject &object, const TfToken& key,
1781 const TfToken &keyPath, const T& value);
1782
1783 // Set metadata for dynamically typed VtValue. Will map the value across
1784 // edit targets if the held value type supports it.
1785 USD_API
1786 bool _SetMetadata(const UsdObject &object,
1787 const TfToken& key,
1788 const TfToken &keyPath,
1789 const VtValue& value);
1790
1791 template <class T>
1792 bool _SetEditTargetMappedMetadata(
1793 const UsdObject &obj, const TfToken& fieldName,
1794 const TfToken &keyPath, const T &newValue);
1795
1796 template <class T>
1797 bool _SetMetadataImpl(
1798 const UsdObject &obj, const TfToken& fieldName,
1799 const TfToken &keyPath, const T &value);
1800
1801 bool _ClearMetadata(const UsdObject &obj, const TfToken& fieldName,
1802 const TfToken &keyPath=TfToken());
1803
1804 // --------------------------------------------------------------------- //
1805 // Misc Internal Helpers
1806 // --------------------------------------------------------------------- //
1807
1808 // Pcp helpers.
1809 PcpCache const *_GetPcpCache() const { return _cache.get(); }
1810 PcpCache *_GetPcpCache() { return _cache.get(); }
1811
1812 // Returns the PrimIndex, using the read-only PcpCache API. We expect prims
1813 // to be composed during initial stage composition, so this method should
1814 // not be used in that context.
1815 const PcpPrimIndex* _GetPcpPrimIndex(const SdfPath& primPath) const;
1816
1817 // Helper to report pcp errors.
1818 void _ReportPcpErrors(const PcpErrorVector &errors,
1819 const std::string &context) const;
1820 void _ReportErrors(const PcpErrorVector &errors,
1821 const std::vector<std::string>& otherErrors,
1822 const std::string &context) const;
1823
1824 // --------------------------------------------------------------------- //
1825 // Scenegraph Composition & Change Processing
1826 // --------------------------------------------------------------------- //
1827
1828 // Compose the prim indexes in the subtrees rooted at the paths in
1829 // \p primIndexPaths. If \p instanceChanges is given, returns
1830 // changes to prototypes and instances due to the discovery of new instances
1831 // during composition.
1832 void _ComposePrimIndexesInParallel(
1833 const std::vector<SdfPath>& primIndexPaths,
1834 const std::string& context,
1835 Usd_InstanceChanges* instanceChanges = nullptr);
1836
1837 // Recompose the subtree rooted at \p prim: compose its type, flags, and
1838 // list of children, then invoke _ComposeSubtree on all its children.
1839 void _ComposeSubtree(
1840 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1841 UsdStagePopulationMask const *mask,
1842 const SdfPath &primIndexPath = SdfPath());
1843 void _ComposeSubtreeImpl(
1844 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1845 UsdStagePopulationMask const *mask,
1846 const SdfPath &primIndexPath = SdfPath());
1847 void _ComposeSubtreesInParallel(
1848 const std::vector<Usd_PrimDataPtr> &prims,
1849 const std::vector<SdfPath> *primIndexPaths = nullptr);
1850
1851 // Composes the full prim type info for the prim based on its type name
1852 // and applied API schemas.
1853 void _ComposePrimTypeInfoImpl(Usd_PrimDataPtr prim);
1854
1855 // Compose subtree rooted at \p prim under \p parent. This function
1856 // ensures that the appropriate prim index is specified for \p prim if
1857 // \p parent is in a prototype.
1858 void _ComposeChildSubtree(Usd_PrimDataPtr prim,
1859 Usd_PrimDataConstPtr parent,
1860 UsdStagePopulationMask const *mask);
1861
1862 // Compose \p prim's list of children and make any modifications necessary
1863 // to its _children member and the stage's _primMap, including possibly
1864 // instantiating new prims, or destroying existing subtrees of prims. The
1865 // any newly created prims *do not* have their prim index, type, flags, or
1866 // children composed.
1867 //
1868 // Compose only \p prim's direct children if recurse=false. Otherwise
1869 // recompose every descendent of \p prim. Callers that pass recurse=false
1870 // should invoke _ComposeSubtree on any newly created prims to ensure caches
1871 // are correctly populated.
1872 void _ComposeChildren(Usd_PrimDataPtr prim,
1873 UsdStagePopulationMask const *mask, bool recurse);
1874
1875 // Instantiate a prim instance. There must not already be an instance
1876 // at \p primPath.
1877 Usd_PrimDataPtr _InstantiatePrim(const SdfPath &primPath);
1878
1879 // Instantiate a prototype prim and sets its parent to pseudoroot.
1880 // There must not already be a prototype at \p primPath.
1881 Usd_PrimDataPtr _InstantiatePrototypePrim(const SdfPath &primPath);
1882
1883 // For \p prim and all of its descendants, remove from _primMap and empty
1884 // their _children vectors.
1885 void _DestroyPrim(Usd_PrimDataPtr prim);
1886
1887 // Destroy the prim subtrees rooted at each path in \p paths. \p paths may
1888 // not contain any path that is a descendent of another path in \p paths.
1889 void _DestroyPrimsInParallel(const std::vector<SdfPath>& paths);
1890
1891 // Invoke _DestroyPrim() on all of \p prim's direct children.
1892 void _DestroyDescendents(Usd_PrimDataPtr prim);
1893
1894 // Returns true if the object at the given path is a descendant of
1895 // an instance prim, i.e. a prim beneath an instance prim, or a property
1896 // of a prim beneath an instance prim.
1897 bool _IsObjectDescendantOfInstance(const SdfPath& path) const;
1898
1899 // If the given prim is an instance, returns the corresponding
1900 // prototype prim. Otherwise, returns an invalid prim.
1901 Usd_PrimDataConstPtr _GetPrototypeForInstance(Usd_PrimDataConstPtr p) const;
1902
1903 // Returns the path of the Usd prim using the prim index at the given path.
1904 SdfPath _GetPrimPathUsingPrimIndexAtPath(const SdfPath& primIndexPath) const;
1905
1906 // Update stage contents in response to changes in scene description.
1907 void _HandleLayersDidChange(const SdfNotice::LayersDidChangeSentPerLayer &);
1908
1909 // Update stage contents in response to changes to the asset resolver.
1910 void _HandleResolverDidChange(const ArNotice::ResolverChanged &);
1911
1912 // Process stage change information stored in _pendingChanges.
1913 // _pendingChanges will be set to nullptr by the end of the function.
1914 void _ProcessPendingChanges();
1915
1916 // Remove scene description for the prim at \p fullPath in the current edit
1917 // target.
1918 bool _RemovePrim(const SdfPath& fullPath);
1919
1920 SdfPrimSpecHandle _GetPrimSpec(const SdfPath& fullPath);
1921
1922 // Find and return the defining spec type for the property spec at the given
1923 // path, or SdfSpecTypeUnknown if none exists. The defining spec type is
1924 // either the builtin definition's spec type, if the indicated property is
1925 // builtin, otherwise it's the strongest authored spec's type if one exists,
1926 // otherwise it's SdfSpecTypeUnknown.
1927 SdfSpecType _GetDefiningSpecType(Usd_PrimDataConstPtr primData,
1928 const TfToken &propName) const;
1929
1930 // Helper to apply Pcp changes and recompose the scenegraph accordingly,
1931 // given an optional initial set of paths to recompose.
1932 void _Recompose(const PcpChanges &changes);
1933 template <class T>
1934 void _Recompose(const PcpChanges &changes, T *pathsToRecompose);
1935 template <class T>
1936 void _RecomposePrims(T *pathsToRecompose);
1937
1938 // Helper for _Recompose to find the subtrees that need to be
1939 // fully recomposed and to recompose the name children of the
1940 // parents of these subtrees. Note that [start, finish) must be a
1941 // sorted range of map iterators whose keys are paths with no descendent
1942 // paths. In C++20, consider using the ranges API to improve this.
1943 template <class Iter>
1944 void _ComputeSubtreesToRecompose(Iter start, Iter finish,
1945 std::vector<Usd_PrimDataPtr>* recompose);
1946
1947 // return true if the path is valid for load/unload operations.
1948 // This method will emit errors when invalid paths are encountered.
1949 bool _IsValidForLoad(const SdfPath& path) const;
1950 bool _IsValidForUnload(const SdfPath& path) const;
1951
1952 // Discover all payloads in a given subtree, adding the path of each
1953 // discovered prim index to the \p primIndexPaths set. If specified,
1954 // the corresponding UsdPrim path will be added to the \p usdPrimPaths
1955 // set. The root path will be considered for inclusion in the result set.
1956 //
1957 // Note that some payloads may not be discoverable in until an ancestral
1958 // payload has been included. UsdStage::LoadAndUnload takes this into
1959 // account.
1960 void _DiscoverPayloads(const SdfPath& rootPath,
1961 UsdLoadPolicy policy,
1962 SdfPathSet* primIndexPaths,
1963 bool unloadedOnly = false,
1964 SdfPathSet* usdPrimPaths = nullptr) const;
1965
1966 // ===================================================================== //
1967 // VALUE RESOLUTION //
1968 // ===================================================================== //
1969 // --------------------------------------------------------------------- //
1970 // Specialized Value Resolution
1971 // --------------------------------------------------------------------- //
1972
1973 // Helpers for resolving values for metadata fields requiring
1974 // special behaviors.
1975 static SdfSpecifier _GetSpecifier(Usd_PrimDataConstPtr primData);
1976 static TfToken _GetKind(Usd_PrimDataConstPtr primData);
1977 static bool _IsActive(Usd_PrimDataConstPtr primData);
1978
1979 // Custom is true if it is true anywhere in the stack.
1980 bool _IsCustom(const UsdProperty &prop) const;
1981
1982 // Variability is determined by the weakest opinion in the stack.
1983 SdfVariability _GetVariability(const UsdProperty &prop) const;
1984
1985 // Helper functions for resolving asset paths during value resolution.
1986 void _MakeResolvedAssetPaths(UsdTimeCode time, const UsdAttribute &attr,
1987 SdfAssetPath *assetPaths,
1988 size_t numAssetPaths,
1989 bool anchorAssetPathsOnly = false) const;
1990
1991 void _MakeResolvedAssetPathsValue(UsdTimeCode time, const UsdAttribute &attr,
1992 VtValue *value,
1993 bool anchorAssetPathsOnly = false) const;
1994
1995 void _MakeResolvedTimeCodes(UsdTimeCode time, const UsdAttribute &attr,
1996 SdfTimeCode *timeCodes,
1997 size_t numTimeCodes) const;
1998
1999 void _MakeResolvedPathExpressions(
2000 UsdTimeCode time, const UsdAttribute &attr,
2001 SdfPathExpression *pathExprs,
2002 size_t numPathExprs) const;
2003
2004 void _MakeResolvedAttributeValue(UsdTimeCode time, const UsdAttribute &attr,
2005 VtValue *value) const;
2006
2007 // --------------------------------------------------------------------- //
2008 // Metadata Resolution
2009 // --------------------------------------------------------------------- //
2010
2011public:
2012 // Trait that allows us to call the correct version of _GetMetadata for
2013 // types that require type specific value resolution as opposed to just
2014 // strongest opinion. These types also use type specific resolution
2015 // in _GetValue.
2016 template <class T>
2017 struct _HasTypeSpecificResolution {
2018 static const bool value =
2019 std::is_same<T, SdfAssetPath>::value ||
2020 std::is_same<T, VtArray<SdfAssetPath>>::value ||
2021 std::is_same<T, SdfTimeCode>::value ||
2022 std::is_same<T, VtArray<SdfTimeCode>>::value ||
2023 std::is_same<T, SdfPathExpression>::value ||
2024 std::is_same<T, VtArray<SdfPathExpression>>::value ||
2025 std::is_same<T, SdfTimeSampleMap>::value ||
2026 std::is_same<T, VtDictionary>::value;
2027 };
2028
2029private:
2030 // Get metadata for types that do not have type specific value resolution.
2031 template <class T>
2032 typename std::enable_if<!_HasTypeSpecificResolution<T>::value, bool>::type
2033 _GetMetadata(const UsdObject &obj,
2034 const TfToken& fieldName,
2035 const TfToken &keyPath,
2036 bool useFallbacks,
2037 T* result) const;
2038
2039 // Get metadata for types that do have type specific value resolution.
2040 template <class T>
2041 typename std::enable_if<_HasTypeSpecificResolution<T>::value, bool>::type
2042 _GetMetadata(const UsdObject &obj,
2043 const TfToken& fieldName,
2044 const TfToken &keyPath,
2045 bool useFallbacks,
2046 T* result) const;
2047
2048 // Get metadata as a dynamically typed VtValue. Will perform type specific
2049 // value resolution if the returned held type requires it.
2050 bool _GetMetadata(const UsdObject &obj,
2051 const TfToken& fieldName,
2052 const TfToken &keyPath,
2053 bool useFallbacks,
2054 VtValue* result) const;
2055
2056 // Gets a metadata value using only strongest value resolution. It is
2057 // assumed that result is holding a value that does not require type
2058 // specific value resolution.
2059 USD_API
2060 bool _GetStrongestResolvedMetadata(const UsdObject &obj,
2061 const TfToken& fieldName,
2062 const TfToken &keyPath,
2063 bool useFallbacks,
2064 SdfAbstractDataValue* result) const;
2065
2066 // Gets a metadata value with the type specific value resolution for the
2067 // type applied. This is only implemented for types that
2068 // _HasTypeSpecificResolution.
2069 template <class T>
2070 USD_API
2071 bool _GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2072 const TfToken& fieldName,
2073 const TfToken &keyPath,
2074 bool useFallbacks,
2075 T* result) const;
2076
2077 template <class Composer>
2078 void _GetAttrTypeImpl(const UsdAttribute &attr,
2079 const TfToken &fieldName,
2080 bool useFallbacks,
2081 Composer *composer) const;
2082
2083 template <class Composer>
2084 void _GetAttrVariabilityImpl(const UsdAttribute &attr,
2085 bool useFallbacks,
2086 Composer *composer) const;
2087
2088 template <class Composer>
2089 void _GetPropCustomImpl(const UsdProperty &prop,
2090 bool useFallbacks,
2091 Composer *composer) const;
2092
2093 template <class Composer>
2094 bool _GetSpecialPropMetadataImpl(const UsdObject &obj,
2095 const TfToken &fieldName,
2096 const TfToken &keyPath,
2097 bool useFallbacks,
2098 Composer *composer) const;
2099 template <class Composer>
2100 bool _GetMetadataImpl(const UsdObject &obj,
2101 const TfToken& fieldName,
2102 const TfToken& keyPath,
2103 bool includeFallbacks,
2104 Composer *composer) const;
2105
2106 template <class Composer>
2107 bool _GetGeneralMetadataImpl(const UsdObject &obj,
2108 const TfToken& fieldName,
2109 const TfToken& keyPath,
2110 bool includeFallbacks,
2111 Composer *composer) const;
2112
2113 // NOTE: The "authoredOnly" flag is not yet in use, but when we have
2114 // support for prim-based metadata fallbacks, they should be ignored when
2115 // this flag is set to true.
2116 bool _HasMetadata(const UsdObject &obj, const TfToken& fieldName,
2117 const TfToken &keyPath, bool useFallbacks) const;
2118
2120 _ListMetadataFields(const UsdObject &obj, bool useFallbacks) const;
2121
2122 void _GetAllMetadata(const UsdObject &obj,
2123 bool useFallbacks,
2124 UsdMetadataValueMap* result,
2125 bool anchorAssetPathsOnly = false) const;
2126
2127 // --------------------------------------------------------------------- //
2128 // Default & TimeSample Resolution
2129 // --------------------------------------------------------------------- //
2130
2131 void _GetResolveInfo(const UsdAttribute &attr,
2132 UsdResolveInfo *resolveInfo,
2133 const UsdTimeCode *time = nullptr) const;
2134
2135 void _GetResolveInfoWithResolveTarget(
2136 const UsdAttribute &attr,
2137 const UsdResolveTarget &resolveTarget,
2138 UsdResolveInfo *resolveInfo,
2139 const UsdTimeCode *time = nullptr) const;
2140
2141 template <class T> struct _ExtraResolveInfo;
2142
2143 // Gets the value resolve info for the given attribute. If time is provided,
2144 // the resolve info is evaluated for that specific time (which may be
2145 // default). Otherwise, if time is null, the resolve info is evaluated for
2146 // "any numeric time" and will not populate values in extraInfo that
2147 // require a specific time to be evaluated.
2148 template <class T>
2149 void _GetResolveInfo(const UsdAttribute &attr,
2150 UsdResolveInfo *resolveInfo,
2151 const UsdTimeCode *time = nullptr,
2152 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2153
2154 // Gets the value resolve info for the given attribute using the given
2155 // resolve target. If time is provided, the resolve info is evaluated for
2156 // that specific time (which may be default). Otherwise, if time is null,
2157 // the resolve info is evaluated for "any numeric time" and will not
2158 // populate values in extraInfo that require a specific time to be
2159 // evaluated.
2160 template <class T>
2161 void _GetResolveInfoWithResolveTarget(
2162 const UsdAttribute &attr,
2163 const UsdResolveTarget &resolveTarget,
2164 UsdResolveInfo *resolveInfo,
2165 const UsdTimeCode *time = nullptr,
2166 _ExtraResolveInfo<T> *extraInfo = nullptr) const;
2167
2168 // Shared implementation function for _GetResolveInfo and
2169 // _GetResolveInfoWithResolveTarget. The only difference between how these
2170 // two functions behave is in how they create the Usd_Resolver used for
2171 // iterating over nodes and layers, thus they provide this implementation
2172 // with the needed MakeUsdResolverFn to create the Usd_Resolver.
2173 template <class T, class MakeUsdResolverFn>
2174 void _GetResolveInfoImpl(const UsdAttribute &attr,
2175 UsdResolveInfo *resolveInfo,
2176 const UsdTimeCode *time,
2177 _ExtraResolveInfo<T> *extraInfo,
2178 const MakeUsdResolverFn &makeUsdResolveFn) const;
2179
2180 template <class T> struct _ResolveInfoResolver;
2181 struct _PropertyStackResolver;
2182
2183 template <class Resolver, class MakeUsdResolverFn>
2184 void _GetResolvedValueAtDefaultImpl(
2185 const UsdProperty &prop,
2186 Resolver *resolver,
2187 const MakeUsdResolverFn &makeUsdResolverFn) const;
2188
2189 template <class Resolver, class MakeUsdResolverFn>
2190 void _GetResolvedValueAtTimeImpl(
2191 const UsdProperty &prop,
2192 Resolver *resolver,
2193 const double *time,
2194 const MakeUsdResolverFn &makeUsdResolverFn) const;
2195
2196 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2197 VtValue* result) const;
2198
2199 template <class T>
2200 bool _GetValue(UsdTimeCode time, const UsdAttribute &attr,
2201 T* result) const;
2202
2203 template <class T>
2204 bool _GetValueImpl(UsdTimeCode time, const UsdAttribute &attr,
2205 Usd_InterpolatorBase* interpolator,
2206 T* value) const;
2207
2208 USD_API
2209 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2210 UsdTimeCode time, const UsdAttribute &attr,
2211 VtValue* result) const;
2212
2213 template <class T>
2214 USD_API
2215 bool _GetValueFromResolveInfo(const UsdResolveInfo &info,
2216 UsdTimeCode time, const UsdAttribute &attr,
2217 T* result) const;
2218
2219 template <class T>
2220 bool _GetValueFromResolveInfoImpl(const UsdResolveInfo &info,
2221 UsdTimeCode time, const UsdAttribute &attr,
2222 Usd_InterpolatorBase* interpolator,
2223 T* value) const;
2224
2225 template <class T>
2226 bool _GetDefaultValueFromResolveInfoImpl(const UsdResolveInfo &info,
2227 const UsdAttribute &attr,
2228 T* value) const;
2229
2230 Usd_AssetPathContext
2231 _GetAssetPathContext(UsdTimeCode time, const UsdAttribute &attr) const;
2232
2233 // --------------------------------------------------------------------- //
2234 // Specialized Time Sample I/O
2235 // --------------------------------------------------------------------- //
2236
2243 bool _GetTimeSamplesInInterval(const UsdAttribute &attr,
2244 const GfInterval& interval,
2245 std::vector<double>* times) const;
2246
2247 bool _GetTimeSamplesInIntervalFromResolveInfo(
2248 const UsdResolveInfo &info,
2249 const UsdAttribute &attr,
2250 const GfInterval& interval,
2251 std::vector<double>* times) const;
2252
2253 size_t _GetNumTimeSamples(const UsdAttribute &attr) const;
2254
2255 size_t _GetNumTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2256 const UsdAttribute &attr) const;
2257
2261 bool _GetBracketingTimeSamples(const UsdAttribute &attr,
2262 double desiredTime,
2263 bool authoredOnly,
2264 double* lower,
2265 double* upper,
2266 bool* hasSamples) const;
2267
2268 bool _GetBracketingTimeSamplesFromResolveInfo(const UsdResolveInfo &info,
2269 const UsdAttribute &attr,
2270 double desiredTime,
2271 bool authoredOnly,
2272 double* lower,
2273 double* upper,
2274 bool* hasSamples) const;
2275
2276 bool _ValueMightBeTimeVarying(const UsdAttribute &attr) const;
2277
2278 bool _ValueMightBeTimeVaryingFromResolveInfo(const UsdResolveInfo &info,
2279 const UsdAttribute &attr) const;
2280
2281 void _RegisterPerLayerNotices();
2282 void _RegisterResolverChangeNotice();
2283
2284 // Helper to obtain a malloc tag string for this stage.
2285 inline char const *_GetMallocTagId() const;
2286
2287private:
2288
2289 // The 'pseudo root' prim.
2290 Usd_PrimDataPtr _pseudoRoot;
2291
2292 // The stage's root layer.
2293 SdfLayerRefPtr _rootLayer;
2294
2295 // Every UsdStage has an implicit, in-memory session layer.
2296 // This is to allow for runtime overrides such as variant selections.
2297 SdfLayerRefPtr _sessionLayer;
2298
2299 // The stage's EditTarget.
2300 UsdEditTarget _editTarget;
2301 bool _editTargetIsLocalLayer;
2302
2303 std::unique_ptr<PcpCache> _cache;
2304 std::unique_ptr<Usd_ClipCache> _clipCache;
2305 std::unique_ptr<Usd_InstanceCache> _instanceCache;
2306
2307 TfHashMap<TfToken, TfToken, TfHash> _invalidPrimTypeToFallbackMap;
2308
2309 size_t _usedLayersRevision;
2310
2311 // A concurrent map from Path to Prim, for fast random access.
2312 struct _TbbHashEq {
2313 inline bool equal(SdfPath const &l, SdfPath const &r) const {
2314 return l == r;
2315 }
2316 inline size_t hash(SdfPath const &path) const {
2317 return path.GetHash();
2318 }
2319 };
2320 using PathToNodeMap = tbb::concurrent_hash_map<
2321 SdfPath, Usd_PrimDataIPtr, _TbbHashEq>;
2322 PathToNodeMap _primMap;
2323
2324 // The interpolation type used for all attributes on the stage.
2325 UsdInterpolationType _interpolationType;
2326
2327 typedef std::vector<
2328 std::pair<SdfLayerHandle, TfNotice::Key> > _LayerAndNoticeKeyVec;
2329 _LayerAndNoticeKeyVec _layersAndNoticeKeys;
2330 size_t _lastChangeSerialNumber;
2331
2332 TfNotice::Key _resolverChangeKey;
2333
2334 // Data for pending change processing.
2335 class _PendingChanges;
2336 _PendingChanges* _pendingChanges;
2337
2338 std::optional<WorkDispatcher> _dispatcher;
2339
2340 // To provide useful aggregation of malloc stats, we bill everything
2341 // for this stage - from all access points - to this tag.
2342 std::unique_ptr<std::string> _mallocTagID;
2343
2344 // The state used when instantiating the stage.
2345 const InitialLoadSet _initialLoadSet;
2346
2347 // The population mask that applies to this stage.
2348 UsdStagePopulationMask _populationMask;
2349
2350 // The load rules that apply to this stage.
2351 UsdStageLoadRules _loadRules;
2352
2353 bool _isClosingStage;
2354 bool _isWritingFallbackPrimTypes;
2355
2356 friend class UsdAPISchemaBase;
2357 friend class UsdAttribute;
2358 friend class UsdAttributeQuery;
2359 friend class UsdEditTarget;
2360 friend class UsdInherits;
2361 friend class UsdObject;
2362 friend class UsdPrim;
2363 friend class UsdProperty;
2364 friend class UsdRelationship;
2365 friend class UsdSpecializes;
2366 friend class UsdVariantSet;
2367 friend class UsdVariantSets;
2368 friend class Usd_AssetPathContext;
2369 friend class Usd_FlattenAccess;
2370 friend class Usd_PcpCacheAccess;
2371 friend class Usd_PrimData;
2372 friend class Usd_StageOpenRequest;
2373 template <class T> friend struct Usd_AttrGetValueHelper;
2374 friend struct Usd_AttrGetUntypedValueHelper;
2375 template <class RefsOrPayloadsEditorType, class RefsOrPayloadsProxyType>
2376 friend struct Usd_ListEditImpl;
2377};
2378
2379// UsdObject's typed metadata query relies on this specialization being
2380// externally visible and exporting the primary template does not
2381// automatically export this specialization.
2382template <>
2383USD_API
2384bool
2385UsdStage::_GetTypeSpecificResolvedMetadata(const UsdObject &obj,
2386 const TfToken& fieldName,
2387 const TfToken &keyPath,
2388 bool useFallbacks,
2389 SdfTimeSampleMap* result) const;
2390
2391template<typename T>
2392bool
2393UsdStage::GetMetadata(const TfToken& key, T* value) const
2394{
2395 VtValue result;
2396 if (!GetMetadata(key, &result)){
2397 return false;
2398 }
2399
2400 if (result.IsHolding<T>()){
2401 *value = result.UncheckedGet<T>();
2402 return true;
2403 } else {
2404 TF_CODING_ERROR("Requested type %s for stage metadatum %s does not"
2405 " match retrieved type %s",
2406 ArchGetDemangled<T>().c_str(),
2407 key.GetText(),
2408 result.GetTypeName().c_str());
2409 return false;
2410 }
2411}
2412
2413template<typename T>
2414bool
2415UsdStage::SetMetadata(const TfToken& key, const T& value) const
2416{
2417 VtValue in(value);
2418 return SetMetadata(key, in);
2419}
2420
2421template<typename T>
2422bool
2424 T* value) const
2425{
2426 VtValue result;
2427 if (!GetMetadataByDictKey(key, keyPath, &result)){
2428 return false;
2429 }
2430
2431 if (result.IsHolding<T>()){
2432 *value = result.UncheckedGet<T>();
2433 return true;
2434 } else {
2435 TF_CODING_ERROR("Requested type %s for stage metadatum %s[%s] does not"
2436 " match retrieved type %s",
2437 ArchGetDemangled<T>().c_str(),
2438 key.GetText(),
2439 keyPath.GetText(),
2440 result.GetTypeName().c_str());
2441 return false;
2442 }
2443}
2444
2445template<typename T>
2446bool
2448 const T& value) const
2449{
2450 VtValue in(value);
2451 return SetMetadataByDictKey(key, keyPath, in);
2452}
2453
2454// Get metadata for types that do not have type specific value resolution.
2455template <class T>
2456typename std::enable_if<
2457 !UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2458UsdStage::_GetMetadata(const UsdObject &obj,
2459 const TfToken& fieldName,
2460 const TfToken &keyPath,
2461 bool useFallbacks,
2462 T* result) const
2463{
2464 // Since these types don't have type specific value resolution, we can just
2465 // get the strongest metadata value and be done.
2466 SdfAbstractDataTypedValue<T> out(result);
2467 return _GetStrongestResolvedMetadata(
2468 obj, fieldName, keyPath, useFallbacks, &out);
2469}
2470
2471// Get metadata for types that do have type specific value resolution.
2472template <class T>
2473typename std::enable_if<
2474 UsdStage::_HasTypeSpecificResolution<T>::value, bool>::type
2475UsdStage::_GetMetadata(const UsdObject &obj,
2476 const TfToken& fieldName,
2477 const TfToken &keyPath,
2478 bool useFallbacks,
2479 T* result) const
2480{
2481 // Call the templated type specifice resolved metadata implementation that
2482 // will only be implemented for types that support it.
2483 return _GetTypeSpecificResolvedMetadata(
2484 obj, fieldName, keyPath, useFallbacks, result);
2485}
2486
2487
2488// Set metadata for types that don't need to be mapped across edit targets.
2489template <class T>
2490typename std::enable_if<!UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2491UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2492 const TfToken &keyPath, const T& value)
2493{
2494 // Since we know that we don't need to map the value for edit targets,
2495 // we can just type erase the value and set the metadata as is.
2497 return _SetMetadataImpl<SdfAbstractDataConstValue>(
2498 object, key, keyPath, in);
2499}
2500
2501// Set metadata for types that do need to be mapped for edit targets.
2502template <class T>
2503typename std::enable_if<UsdStage::_IsEditTargetMappable<T>::value, bool>::type
2504UsdStage::_SetMetadata(const UsdObject &object, const TfToken& key,
2505 const TfToken &keyPath, const T& value)
2506{
2507 return _SetEditTargetMappedMetadata(object, key, keyPath, value);
2508}
2509
2510PXR_NAMESPACE_CLOSE_SCOPE
2511
2512#endif //PXR_USD_USD_STAGE_H
2513
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:100
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
Definition: layer.h:123
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:73
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:151
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:2415
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)
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:670
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 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:165
@ LoadAll
Load all loadable prims.
Definition: stage.h:166
@ LoadNone
Load no loadable prims.
Definition: stage.h:167
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:2447
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:2423
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:2393
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:653
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:165
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:1081
T const & UncheckedGet() const &
Returns a const reference to the held object if the held object is of type T.
Definition: value.h:1121
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:45
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
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:84
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
Definition: types.h:116
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:172
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:280