30 #include "pxr/usd/usd/api.h"
31 #include "pxr/usd/usd/common.h"
32 #include "pxr/usd/usd/editTarget.h"
33 #include "pxr/usd/usd/interpolation.h"
34 #include "pxr/usd/usd/schemaRegistry.h"
35 #include "pxr/usd/usd/stageLoadRules.h"
36 #include "pxr/usd/usd/stagePopulationMask.h"
37 #include "pxr/usd/usd/prim.h"
39 #include "pxr/base/tf/declarePtrs.h"
40 #include "pxr/base/tf/hashmap.h"
41 #include "pxr/base/tf/weakBase.h"
43 #include "pxr/usd/sdf/declareHandles.h"
44 #include "pxr/usd/sdf/notice.h"
45 #include "pxr/usd/sdf/path.h"
46 #include "pxr/usd/sdf/types.h"
47 #include "pxr/usd/pcp/cache.h"
48 #include "pxr/base/vt/value.h"
49 #include "pxr/base/work/arenaDispatcher.h"
51 #include <boost/optional.hpp>
53 #include <tbb/concurrent_vector.h>
54 #include <tbb/concurrent_unordered_set.h>
55 #include <tbb/spin_rw_mutex.h>
60 #include <unordered_map>
63 PXR_NAMESPACE_OPEN_SCOPE
70 class Usd_InstanceCache;
71 class Usd_InstanceChanges;
72 class Usd_InterpolatorBase;
189 const SdfLayerHandle& sessionLayer,
195 const SdfLayerHandle& sessionLayer,
238 const SdfLayerHandle &sessionLayer,
244 const SdfLayerHandle &sessionLayer,
269 Open(
const std::string& filePath,
332 Open(
const SdfLayerHandle& rootLayer,
337 Open(
const SdfLayerHandle& rootLayer,
338 const SdfLayerHandle& sessionLayer,
343 Open(
const SdfLayerHandle& rootLayer,
349 Open(
const SdfLayerHandle& rootLayer,
350 const SdfLayerHandle& sessionLayer,
383 const SdfLayerHandle& sessionLayer,
397 const SdfLayerHandle& sessionLayer,
595 void LoadAndUnload(
const SdfPathSet &loadSet,
const SdfPathSet &unloadSet,
657 return _populationMask;
677 std::function<
bool (
UsdRelationship const &)>
const &relPred =
nullptr,
678 std::function<
bool (
UsdAttribute const &)>
const &attrPred =
nullptr);
784 Usd_PrimDataConstPtr _GetPrimDataAtPath(
const SdfPath &path)
const;
785 Usd_PrimDataPtr _GetPrimDataAtPath(
const SdfPath &path);
791 _GetPrimDataAtPathOrInMaster(
const SdfPath &path)
const;
958 SdfLayerHandleVector
GetLayerStack(
bool includeSessionLayers=
true)
const;
972 SdfLayerHandleVector
GetUsedLayers(
bool includeClipLayers=
true)
const;
1033 void MuteLayer(
const std::string &layerIdentifier);
1038 void UnmuteLayer(
const std::string &layerIdentifier);
1049 const std::vector<std::string> &unmuteLayers);
1060 bool IsLayerMuted(
const std::string& layerIdentifier)
const;
1083 bool Export(
const std::string &filename,
1084 bool addSourceFileComment=
true,
1097 bool addSourceFileComment=
true)
const;
1185 template<
typename T>
1217 template<
typename T>
1262 template<
typename T>
1264 const T& value)
const;
1467 TfToken *colorManagementSystem);
1485 const TfToken &colorManagementSystem);
1526 struct _IncludePayloadsPredicate;
1539 template <
class... Args>
1561 SdfPropertySpecHandleVector
1564 SdfPropertySpecHandle
1565 _GetPropertyDefinition(
const UsdPrim &prim,
const TfToken &propName)
const;
1567 SdfPropertySpecHandle
1568 _GetPropertyDefinition(
const UsdProperty &prop)
const;
1570 template <
class PropType>
1572 _GetPropertyDefinition(
const UsdProperty &prop)
const;
1574 SdfAttributeSpecHandle
1575 _GetAttributeDefinition(
const UsdAttribute &attr)
const;
1577 SdfRelationshipSpecHandle
1581 _CreatePrimSpecForEditing(
const UsdPrim& prim);
1583 template <
class PropType>
1585 _CreatePropertySpecForEditing(
const UsdProperty &prop);
1587 SdfPropertySpecHandle
1588 _CreatePropertySpecForEditing(
const UsdProperty &prop);
1590 SdfAttributeSpecHandle
1591 _CreateAttributeSpecForEditing(
const UsdAttribute &attr);
1593 SdfRelationshipSpecHandle
1599 std::pair<bool, UsdPrim>
1600 _IsValidPathForCreatingPrim(
const SdfPath &path)
const;
1605 bool _ValidateEditPrim(
const UsdPrim &prim,
const char* operation)
const;
1606 bool _ValidateEditPrimAtPath(
const SdfPath &primPath,
1607 const char* operation)
const;
1611 bool _RemoveProperty(
const SdfPath& path);
1628 bool _SetEditTargetMappedValue(
1638 bool _SetEditTargetMappedMetadata(
1640 const TfToken &keyPath,
const T &newValue);
1643 bool _SetMetadataImpl(
1645 const TfToken &keyPath,
const T &value);
1655 PcpCache const *_GetPcpCache()
const {
return _cache.get(); }
1656 PcpCache *_GetPcpCache() {
return _cache.get(); }
1664 void _ReportPcpErrors(
const PcpErrorVector &errors,
1665 const std::string &context)
const;
1666 void _ReportErrors(
const PcpErrorVector &errors,
1667 const std::vector<std::string>& otherErrors,
1668 const std::string &context)
const;
1678 void _ComposePrimIndexesInParallel(
1679 const std::vector<SdfPath>& primIndexPaths,
1680 const std::string& context,
1681 Usd_InstanceChanges* instanceChanges =
nullptr);
1685 void _ComposeSubtree(
1686 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1689 void _ComposeSubtreeImpl(
1690 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1693 void _ComposeSubtreeInParallel(Usd_PrimDataPtr prim);
1694 void _ComposeSubtreesInParallel(
1695 const std::vector<Usd_PrimDataPtr> &prims,
1696 const std::vector<SdfPath> *primIndexPaths =
nullptr);
1701 void _ComposeChildSubtree(Usd_PrimDataPtr prim,
1702 Usd_PrimDataConstPtr parent,
1715 void _ComposeChildren(Usd_PrimDataPtr prim,
1720 Usd_PrimDataPtr _InstantiatePrim(
const SdfPath &primPath);
1724 void _DestroyPrim(Usd_PrimDataPtr prim);
1728 void _DestroyPrimsInParallel(
const std::vector<SdfPath>& paths);
1731 void _DestroyDescendents(Usd_PrimDataPtr prim);
1736 bool _IsObjectDescendantOfInstance(
const SdfPath& path)
const;
1740 Usd_PrimDataConstPtr _GetMasterForInstance(Usd_PrimDataConstPtr p)
const;
1743 SdfPath _GetPrimPathUsingPrimIndexAtPath(
const SdfPath& primIndexPath)
const;
1750 bool _RemovePrim(
const SdfPath& fullPath);
1752 SdfPrimSpecHandle _GetPrimSpec(
const SdfPath& fullPath);
1759 SdfSpecType _GetDefiningSpecType(Usd_PrimDataConstPtr primData,
1760 const TfToken &propName)
const;
1766 void _Recompose(
const PcpChanges &changes, T *pathsToRecompose);
1768 void _RecomposePrims(
const PcpChanges &changes, T *pathsToRecompose);
1774 template <
class Iter>
1775 void _ComputeSubtreesToRecompose(Iter start, Iter finish,
1776 std::vector<Usd_PrimDataPtr>* recompose);
1781 template <
class PrimIndexPathMap>
1782 void _RemoveMasterSubtreesSubsumedByInstances(
1783 std::vector<Usd_PrimDataPtr>* subtreesToRecompose,
1784 const PrimIndexPathMap& primPathToSourceIndexPathMap)
const;
1788 bool _IsValidForLoad(
const SdfPath& path)
const;
1789 bool _IsValidForUnload(
const SdfPath& path)
const;
1799 void _DiscoverPayloads(
const SdfPath& rootPath,
1801 SdfPathSet* primIndexPaths,
1802 bool unloadedOnly =
false,
1803 SdfPathSet* usdPrimPaths =
nullptr)
const;
1816 SdfSpecifier _GetSpecifier(Usd_PrimDataConstPtr primData)
const;
1827 size_t numAssetPaths,
1828 bool anchorAssetPathsOnly =
false)
const;
1832 bool anchorAssetPathsOnly =
false)
const;
1836 size_t numTimeCodes)
const;
1860 template <
class Composer>
1864 Composer *composer)
const;
1866 template <
class Composer>
1869 Composer *composer)
const;
1871 template <
class Composer>
1874 Composer *composer)
const;
1876 template <
class Composer>
1877 void _GetPrimTypeNameImpl(
const UsdPrim &prim,
1879 Composer *composer)
const;
1881 template <
class Composer>
1882 bool _GetPrimSpecifierImpl(Usd_PrimDataConstPtr primData,
1883 bool useFallbacks, Composer *composer)
const;
1885 template <
class ListOpType,
class Composer>
1886 bool _GetListOpMetadataImpl(
const UsdObject &obj,
1889 Usd_Resolver *resolver,
1890 Composer *composer)
const;
1892 template <
class Composer>
1893 bool _GetSpecialMetadataImpl(
const UsdObject &obj,
1897 Composer *composer)
const;
1898 template <
class Composer>
1899 bool _GetMetadataImpl(
const UsdObject &obj,
1902 bool includeFallbacks,
1903 Composer *composer)
const;
1905 template <
class Composer>
1906 bool _GetGeneralMetadataImpl(
const UsdObject &obj,
1909 bool includeFallbacks,
1910 Composer *composer)
const;
1912 template <
class Composer>
1913 bool _ComposeGeneralMetadataImpl(
const UsdObject &obj,
1916 bool includeFallbacks,
1917 Usd_Resolver* resolver,
1918 Composer *composer)
const;
1924 const TfToken &keyPath,
bool useFallbacks)
const;
1927 _ListMetadataFields(
const UsdObject &obj,
bool useFallbacks)
const;
1929 void _GetAllMetadata(
const UsdObject &obj,
1931 UsdMetadataValueMap* result,
1932 bool anchorAssetPathsOnly =
false)
const;
1934 template <
class Composer>
1936 _GetFallbackMetadataImpl(
const UsdObject &obj,
1939 Composer *composer)
const;
1949 template <
class T>
struct _ExtraResolveInfo;
1955 _ExtraResolveInfo<T> *extraInfo =
nullptr)
const;
1957 template <
class T>
struct _ResolveInfoResolver;
1958 struct _PropertyStackResolver;
1960 template <
class Resolver>
1961 void _GetResolvedValueImpl(
const UsdProperty &prop,
1974 Usd_InterpolatorBase* interpolator,
1978 _GetLayerWithStrongestValue(
1997 Usd_InterpolatorBase* interpolator,
2010 bool _GetTimeSamplesInInterval(
const UsdAttribute &attr,
2012 std::vector<double>* times)
const;
2014 bool _GetTimeSamplesInIntervalFromResolveInfo(
2018 std::vector<double>* times)
const;
2020 size_t _GetNumTimeSamples(
const UsdAttribute &attr)
const;
2022 size_t _GetNumTimeSamplesFromResolveInfo(
const UsdResolveInfo &info,
2028 bool _GetBracketingTimeSamples(
const UsdAttribute &attr,
2033 bool* hasSamples)
const;
2035 bool _GetBracketingTimeSamplesFromResolveInfo(
const UsdResolveInfo &info,
2041 bool* hasSamples)
const;
2043 bool _ValueMightBeTimeVarying(
const UsdAttribute &attr)
const;
2045 bool _ValueMightBeTimeVaryingFromResolveInfo(
const UsdResolveInfo &info,
2048 void _RegisterPerLayerNotices();
2053 Usd_PrimDataPtr _pseudoRoot;
2065 std::unique_ptr<PcpCache> _cache;
2066 std::unique_ptr<Usd_ClipCache> _clipCache;
2067 std::unique_ptr<Usd_InstanceCache> _instanceCache;
2071 SdfPath, Usd_PrimDataIPtr, SdfPath::Hash> PathToNodeMap;
2072 PathToNodeMap _primMap;
2073 mutable boost::optional<tbb::spin_rw_mutex> _primMapMutex;
2078 typedef std::vector<
2079 std::pair<SdfLayerHandle, TfNotice::Key> > _LayerAndNoticeKeyVec;
2080 _LayerAndNoticeKeyVec _layersAndNoticeKeys;
2081 size_t _lastChangeSerialNumber;
2083 boost::optional<WorkArenaDispatcher> _dispatcher;
2087 char const *_mallocTagID;
2098 bool _isClosingStage;
2112 friend class Usd_FlattenAccess;
2113 friend class Usd_PcpCacheAccess;
2114 friend class Usd_PrimData;
2115 friend class Usd_StageOpenRequest;
2116 template <
class T>
friend struct Usd_AttrGetValueHelper;
2117 friend struct Usd_AttrGetUntypedValueHelper;
2118 template <
class RefsOrPayloadsEditorType,
class RefsOrPayloadsProxyType>
2119 friend struct Usd_ListEditImpl;
2122 template<
typename T>
2136 " match retrieved type %s",
2137 ArchGetDemangled<T>().c_str(),
2144 template<
typename T>
2152 template<
typename T>
2166 TF_CODING_ERROR(
"Requested type %s for stage metadatum %s[%s] does not"
2167 " match retrieved type %s",
2168 ArchGetDemangled<T>().c_str(),
2176 template<
typename T>
2179 const T& value)
const
2187 PXR_NAMESPACE_CLOSE_SCOPE
2189 #endif //USD_STAGE_H
USD_API void ExpandPopulationMask(std::function< bool(UsdRelationship const &)> const &relPred=nullptr, std::function< bool(UsdAttribute const &)> const &attrPred=nullptr)
Expand this stage's population mask to include the targets of all relationships that pass relPred and...
static USD_API void SetGlobalVariantFallbacks(const PcpVariantFallbackMap &fallbacks)
Set the global variant fallback preferences used in new UsdStages.
A proxy class for applying listOp edits to the specializes list for a prim.
A unit of scene description that you combine with other units of scene description to form a shot...
USD_API void SetStartTimeCode(double)
Sets the stage's start timeCode.
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
USD_API UsdPrimRange Traverse()
Traverse the active, loaded, defined, non-abstract prims on this stage depth-first.
static USD_API void GetColorConfigFallbacks(SdfAssetPath *colorConfiguration, TfToken *colorManagementSystem)
Returns the global fallback values of 'colorConfiguration' and 'colorManagementSystem'.
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 UsdPrim GetPseudoRoot() const
Return the stage's "pseudo-root" prim, whose name is defined by Usd.
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
T const & UncheckedGet() const
Returns a const reference to the held object if the held object is of type T.
USD_API void SetLoadRules(UsdStageLoadRules const &rules)
Set the UsdStageLoadRules to govern payload inclusion on this stage.
USD_API void SetDefaultPrim(const UsdPrim &prim)
Set the default prim layer metadata in this stage's root layer.
USD_API SdfAssetPath GetColorConfiguration() const
Returns the default color configuration used to interpret the per- attribute color-spaces in the comp...
USD_API void SetInterpolationType(UsdInterpolationType interpolationType)
Sets the interpolation type used during value resolution for all attributes on this stage...
USD_API UsdPrim OverridePrim(const SdfPath &path)
Attempt to ensure a UsdPrim at path exists on this stage.
USD_API UsdInterpolationType GetInterpolationType() const
Returns the interpolation type used during value resolution for all attributes on this stage...
A type-erased container for a field value in an SdfAbstractData.
Object for efficiently making repeated queries for attribute values.
USD_API void LoadAndUnload(const SdfPathSet &loadSet, const SdfPathSet &unloadSet, UsdLoadPolicy policy=UsdLoadWithDescendants)
Unload and load the given path sets.
USD_API double GetFramesPerSecond() const
Returns the stage's framesPerSecond value.
USD_API const UsdEditTarget & GetEditTarget() const
Return the stage's EditTarget.
USD_API UsdPrim CreateClassPrim(const SdfPath &rootPrimPath)
Author an SdfPrimSpec with specifier == SdfSpecifierClass for the class at root prim path path at the...
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
static USD_API UsdStageRefPtr CreateInMemory(InitialLoadSet load=LoadAll)
Creates a new stage only in memory, analogous to creating an anonymous SdfLayer.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
bool IsHolding() const
Return true if this value is holding an object of type T, false otherwise.
static USD_API bool IsSupportedFile(const std::string &filePath)
Indicates whether the specified file is supported by UsdStage.
USD_API UsdPrim GetPrimAtPath(const SdfPath &path) const
Return the UsdPrim at path, or an invalid UsdPrim if none exists.
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
UsdStageLoadRules const & GetLoadRules() const
Return the stage's current UsdStageLoadRules governing payload inclusion.
USD_API void SetTimeCodesPerSecond(double timeCodesPerSecond) const
Sets the stage's timeCodesPerSecond value.
Load a prim plus all its descendants.
SdfSpecType
An enum that specifies the type of an object.
A proxy class for applying listOp edits to the inherit paths list for a prim.
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 void Save()
Calls SdfLayer::Save on all dirty layers contributing to this stage except session layers and sublaye...
USD_API SdfLayerHandle GetRootLayer() const
Return this stage's root layer.
USD_API bool IsLayerMuted(const std::string &layerIdentifier) const
Returns true if the layer specified by layerIdentifier is muted in this cache, false otherwise...
The base class for all API schemas.
Container for information about the source of an attribute's value, i.e.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check...
USD_API bool HasLocalLayer(const SdfLayerHandle &layer) const
Return true if layer is one of the layers in this stage's local, root layerStack. ...
Enable a concrete base class for use with TfRefPtr.
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 void SetColorConfiguration(const SdfAssetPath &colorConfig) const
Sets the default color configuration to be used to interpret the per-attribute color-spaces in the co...
UsdStagePopulationMask GetPopulationMask() const
Return this stage's population mask.
Token for efficient comparison, assignment, and hashing of known strings.
USD_API SdfLayerHandleVector GetLayerStack(bool includeSessionLayers=true) const
Return this stage's local layers in strong-to-weak order.
USD_API double GetEndTimeCode() const
Returns the stage's end timeCode.
USD_API bool ClearMetadataByDictKey(const TfToken &key, const TfToken &keyPath) const
Clear any authored value identified by key and keyPath at the current EditTarget. ...
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
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 void UnmuteLayer(const std::string &layerIdentifier)
Unmute the layer identified by layerIdentifier if it had previously been muted.
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.
Value type that represents a time code.
A UsdVariantSet represents a single VariantSet in USD (e.g.
USD_API void SetFramesPerSecond(double framesPerSecond) const
Sets the stage's framesPerSecond value.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
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 ...
Base class for Usd scenegraph objects, providing common API.
Defines a mapping from scene graph paths to Sdf spec paths in a SdfLayer where edits should be direct...
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.
This class represents rules that govern payload inclusion on UsdStages.
SdfVariability
An enum that identifies variability types for attributes.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
InitialLoadSet
Specifies the initial set of prims to load when opening a UsdStage.
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
USD_API SdfPathSet GetLoadSet()
Returns a set of all loaded paths.
std::vector< TfToken > TfTokenVector
Convenience types.
A basic mathematical interval class.
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 ...
A path value used to locate objects in layers or scenegraphs.
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...
VT_API std::string GetTypeName() const
Return the type name of the held typeid.
USD_API UsdObject GetObjectAtPath(const SdfPath &path) const
Return the UsdObject at path, or an invalid UsdObject if none exists.
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
USD_API double GetStartTimeCode() const
Returns the stage's start timeCode.
USD_API UsdPrimRange TraverseAll()
Traverse all the prims on this stage depth-first.
USD_API void SaveSessionLayers()
Calls SdfLayer::Save on all dirty session layers and sublayers of session layers contributing to this...
USD_API void SetPopulationMask(UsdStagePopulationMask const &mask)
Set this stage's population mask and recompose the stage.
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 void SetEndTimeCode(double)
Sets the stage's end timeCode.
UsdLoadPolicy
Controls UsdStage::Load() and UsdPrim::Load() behavior regarding whether or not descendant prims are ...
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
Resolve the requested dictionary sub-element keyPath of dictionary-valued metadatum named key...
Contains an asset path and an optional resolved path.
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 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...
Notice sent per-layer indicating all layers whose contents have changed within a single round of chan...
Base class for UsdAttribute and UsdRelationship scenegraph objects.
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
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.
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
USD_API double GetTimeCodesPerSecond() const
Returns the stage's timeCodesPerSecond value.
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 const std::vector< std::string > & GetMutedLayers() const
Returns a vector of all layers that have been muted on this stage.
USD_API void Reload()
Calls SdfLayer::Reload on all layers contributing to this stage, except session layers and sublayers ...
USD_API std::vector< UsdPrim > GetMasters() const
Returns all master prims.
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 SdfPathSet FindLoadable(const SdfPath &rootPath=SdfPath::AbsoluteRootPath())
Returns an SdfPathSet of all paths that can be loaded.
USD_API void SetEditTarget(const UsdEditTarget &editTarget)
Set the stage's EditTarget.
USD_API TfToken GetColorManagementSystem() const
Sets the name of the color management system to be used for loading and interpreting the color config...
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...
static USD_API void SetColorConfigFallbacks(const SdfAssetPath &colorConfiguration, const TfToken &colorManagementSystem)
Sets the global fallback values of color configuration metadata which includes the 'colorConfiguratio...
USD_API SdfLayerHandle GetSessionLayer() const
Return this stage's root session layer.
UsdInterpolationType
Attribute value interpolation options.
An asset resolver context allows clients to provide additional data to the resolver for use during re...
USD_API void MuteLayer(const std::string &layerIdentifier)
Mute the layer identified by layerIdentifier.
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.
USD_API SdfLayerRefPtr Flatten(bool addSourceFileComment=true) const
Returns a single, anonymous, merged layer for this composite scene.
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(...
UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim.
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 bool HasMetadata(const TfToken &key) const
Returns true if the key has a meaningful value, that is, if GetMetadata() will provide a value...
static USD_API PcpVariantFallbackMap GetGlobalVariantFallbacks()
Get the global variant fallback preferences used in new UsdStages.
Enable a concrete base class for use with TfWeakPtr.
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.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
This class represents a mask that may be applied to a UsdStage to limit the set of UsdPrim s it popul...
USD_API ArResolverContext GetPathResolverContext() const
Return the path resolver context for all path resolution during composition of this stage...
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 UsdEditTarget GetEditTargetForLocalLayer(size_t i)
Return a UsdEditTarget for editing the layer at index i in the layer stack.
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...
char const * GetText() const
Return the text that this token represents.