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