24 #ifndef PXR_USD_USD_STAGE_H 25 #define PXR_USD_USD_STAGE_H 30 #include "pxr/usd/usd/api.h" 32 #include "pxr/usd/usd/editTarget.h" 34 #include "pxr/usd/usd/schemaRegistry.h" 36 #include "pxr/usd/usd/stagePopulationMask.h" 40 #include "pxr/base/tf/hashmap.h" 43 #include "pxr/usd/ar/ar.h" 44 #include "pxr/usd/ar/notice.h" 46 #include "pxr/usd/sdf/notice.h" 47 #include "pxr/usd/sdf/path.h" 49 #include "pxr/usd/pcp/cache.h" 50 #include "pxr/base/vt/value.h" 53 #include <boost/optional.hpp> 55 #include <tbb/concurrent_vector.h> 56 #include <tbb/concurrent_unordered_set.h> 57 #include <tbb/concurrent_hash_map.h> 58 #include <tbb/spin_rw_mutex.h> 63 #include <unordered_map> 66 PXR_NAMESPACE_OPEN_SCOPE
73 class Usd_InstanceCache;
74 class Usd_InstanceChanges;
75 class Usd_InterpolatorBase;
188 static UsdStageRefPtr
193 static UsdStageRefPtr
195 const SdfLayerHandle& sessionLayer,
199 static UsdStageRefPtr
201 const SdfLayerHandle& sessionLayer,
206 static UsdStageRefPtr
229 static UsdStageRefPtr
233 static UsdStageRefPtr
238 static UsdStageRefPtr
244 static UsdStageRefPtr
246 const SdfLayerHandle &sessionLayer,
250 static UsdStageRefPtr
252 const SdfLayerHandle &sessionLayer,
272 static UsdStageRefPtr
276 static UsdStageRefPtr
277 Open(
const std::string& filePath,
299 static UsdStageRefPtr
305 static UsdStageRefPtr
340 static UsdStageRefPtr
341 Open(
const SdfLayerHandle& rootLayer,
345 static UsdStageRefPtr
346 Open(
const SdfLayerHandle& rootLayer,
347 const SdfLayerHandle& sessionLayer,
351 static UsdStageRefPtr
352 Open(
const SdfLayerHandle& rootLayer,
357 static UsdStageRefPtr
358 Open(
const SdfLayerHandle& rootLayer,
359 const SdfLayerHandle& sessionLayer,
384 static UsdStageRefPtr
390 static UsdStageRefPtr
392 const SdfLayerHandle& sessionLayer,
397 static UsdStageRefPtr
404 static UsdStageRefPtr
406 const SdfLayerHandle& sessionLayer,
604 void LoadAndUnload(
const SdfPathSet &loadSet,
const SdfPathSet &unloadSet,
666 return _populationMask;
686 std::function<
bool (
UsdRelationship const &)>
const &relPred =
nullptr,
687 std::function<
bool (
UsdAttribute const &)>
const &attrPred =
nullptr);
826 Usd_PrimDataConstPtr _GetPrimDataAtPath(
const SdfPath &path)
const;
827 Usd_PrimDataPtr _GetPrimDataAtPath(
const SdfPath &path);
833 _GetPrimDataAtPathOrInPrototype(
const SdfPath &path)
const;
837 _GetInstancesForPrototype(
const UsdPrim& prototype)
const;
1004 SdfLayerHandleVector
GetLayerStack(
bool includeSessionLayers=
true)
const;
1018 SdfLayerHandleVector
GetUsedLayers(
bool includeClipLayers=
true)
const;
1077 void MuteLayer(
const std::string &layerIdentifier);
1082 void UnmuteLayer(
const std::string &layerIdentifier);
1093 const std::vector<std::string> &unmuteLayers);
1104 bool IsLayerMuted(
const std::string& layerIdentifier)
const;
1127 bool Export(
const std::string &filename,
1128 bool addSourceFileComment=
true,
1141 bool addSourceFileComment=
true)
const;
1229 template<
typename T>
1261 template<
typename T>
1306 template<
typename T>
1308 const T& value)
const;
1539 TfToken *colorManagementSystem);
1557 const TfToken &colorManagementSystem);
1598 struct _IncludePayloadsPredicate;
1611 template <
class... Args>
1612 static UsdStageRefPtr _OpenImpl(
InitialLoadSet load, Args
const &... args);
1622 static UsdStageRefPtr
1633 SdfPropertySpecHandleVector
1636 SdfPropertySpecHandle
1637 _GetSchemaPropertySpec(
const UsdPrim &prim,
const TfToken &propName)
const;
1639 SdfPropertySpecHandle
1640 _GetSchemaPropertySpec(
const UsdProperty &prop)
const;
1642 template <
class PropType>
1644 _GetSchemaPropertySpec(
const UsdProperty &prop)
const;
1646 SdfAttributeSpecHandle
1647 _GetSchemaAttributeSpec(
const UsdAttribute &attr)
const;
1649 SdfRelationshipSpecHandle
1653 _CreatePrimSpecForEditing(
const UsdPrim& prim);
1655 template <
class PropType>
1657 _CreatePropertySpecForEditing(
const UsdProperty &prop);
1659 SdfPropertySpecHandle
1660 _CreatePropertySpecForEditing(
const UsdProperty &prop);
1662 SdfAttributeSpecHandle
1663 _CreateAttributeSpecForEditing(
const UsdAttribute &attr);
1665 SdfRelationshipSpecHandle
1671 std::pair<bool, UsdPrim>
1672 _IsValidPathForCreatingPrim(
const SdfPath &path)
const;
1677 bool _ValidateEditPrim(
const UsdPrim &prim,
const char* operation)
const;
1678 bool _ValidateEditPrimAtPath(
const SdfPath &primPath,
1679 const char* operation)
const;
1683 bool _RemoveProperty(
const SdfPath& path);
1697 struct _IsEditTargetMappable {
1698 static const bool value =
1699 std::is_same<T, SdfTimeCode>::value ||
1700 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1701 std::is_same<T, SdfTimeSampleMap>::value ||
1702 std::is_same<T, VtDictionary>::value;
1707 typename std::enable_if<!_IsEditTargetMappable<T>::value,
bool>::type
1713 typename std::enable_if<_IsEditTargetMappable<T>::value,
bool>::type
1723 bool _SetEditTargetMappedValue(
1734 typename std::enable_if<!_IsEditTargetMappable<T>::value,
bool>::type
1736 const TfToken &keyPath,
const T& value);
1740 typename std::enable_if<_IsEditTargetMappable<T>::value,
bool>::type
1742 const TfToken &keyPath,
const T& value);
1747 bool _SetMetadata(
const UsdObject &
object,
1753 bool _SetEditTargetMappedMetadata(
1755 const TfToken &keyPath,
const T &newValue);
1758 bool _SetMetadataImpl(
1760 const TfToken &keyPath,
const T &value);
1770 PcpCache const *_GetPcpCache()
const {
return _cache.get(); }
1771 PcpCache *_GetPcpCache() {
return _cache.get(); }
1779 void _ReportPcpErrors(
const PcpErrorVector &errors,
1780 const std::string &context)
const;
1781 void _ReportErrors(
const PcpErrorVector &errors,
1782 const std::vector<std::string>& otherErrors,
1783 const std::string &context)
const;
1793 void _ComposePrimIndexesInParallel(
1794 const std::vector<SdfPath>& primIndexPaths,
1795 const std::string& context,
1796 Usd_InstanceChanges* instanceChanges =
nullptr);
1800 void _ComposeSubtree(
1801 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1804 void _ComposeSubtreeImpl(
1805 Usd_PrimDataPtr prim, Usd_PrimDataConstPtr parent,
1808 void _ComposeSubtreesInParallel(
1809 const std::vector<Usd_PrimDataPtr> &prims,
1810 const std::vector<SdfPath> *primIndexPaths =
nullptr);
1815 void _ComposeChildSubtree(Usd_PrimDataPtr prim,
1816 Usd_PrimDataConstPtr parent,
1829 void _ComposeChildren(Usd_PrimDataPtr prim,
1834 Usd_PrimDataPtr _InstantiatePrim(
const SdfPath &primPath);
1838 Usd_PrimDataPtr _InstantiatePrototypePrim(
const SdfPath &primPath);
1842 void _DestroyPrim(Usd_PrimDataPtr prim);
1846 void _DestroyPrimsInParallel(
const std::vector<SdfPath>& paths);
1849 void _DestroyDescendents(Usd_PrimDataPtr prim);
1854 bool _IsObjectDescendantOfInstance(
const SdfPath& path)
const;
1858 Usd_PrimDataConstPtr _GetPrototypeForInstance(Usd_PrimDataConstPtr p)
const;
1861 SdfPath _GetPrimPathUsingPrimIndexAtPath(
const SdfPath& primIndexPath)
const;
1871 void _ProcessPendingChanges();
1875 bool _RemovePrim(
const SdfPath& fullPath);
1877 SdfPrimSpecHandle _GetPrimSpec(
const SdfPath& fullPath);
1884 SdfSpecType _GetDefiningSpecType(Usd_PrimDataConstPtr primData,
1885 const TfToken &propName)
const;
1891 void _Recompose(
const PcpChanges &changes, T *pathsToRecompose);
1893 void _RecomposePrims(T *pathsToRecompose);
1899 template <
class Iter>
1900 void _ComputeSubtreesToRecompose(Iter start, Iter finish,
1901 std::vector<Usd_PrimDataPtr>* recompose);
1905 bool _IsValidForLoad(
const SdfPath& path)
const;
1906 bool _IsValidForUnload(
const SdfPath& path)
const;
1916 void _DiscoverPayloads(
const SdfPath& rootPath,
1918 SdfPathSet* primIndexPaths,
1919 bool unloadedOnly =
false,
1920 SdfPathSet* usdPrimPaths =
nullptr)
const;
1931 static SdfSpecifier _GetSpecifier(Usd_PrimDataConstPtr primData);
1932 static TfToken _GetKind(Usd_PrimDataConstPtr primData);
1933 static bool _IsActive(Usd_PrimDataConstPtr primData);
1944 size_t numAssetPaths,
1945 bool anchorAssetPathsOnly =
false)
const;
1949 bool anchorAssetPathsOnly =
false)
const;
1953 size_t numTimeCodes)
const;
1968 struct _HasTypeSpecificResolution {
1969 static const bool value =
1970 std::is_same<T, SdfAssetPath>::value ||
1971 std::is_same<T, VtArray<SdfAssetPath>>::value ||
1972 std::is_same<T, SdfTimeCode>::value ||
1973 std::is_same<T, VtArray<SdfTimeCode>>::value ||
1974 std::is_same<T, SdfTimeSampleMap>::value ||
1975 std::is_same<T, VtDictionary>::value;
1981 typename std::enable_if<!_HasTypeSpecificResolution<T>::value,
bool>::type
1990 typename std::enable_if<_HasTypeSpecificResolution<T>::value,
bool>::type
2009 bool _GetStrongestResolvedMetadata(
const UsdObject &obj,
2020 bool _GetTypeSpecificResolvedMetadata(
const UsdObject &obj,
2026 template <
class Composer>
2030 Composer *composer)
const;
2032 template <
class Composer>
2035 Composer *composer)
const;
2037 template <
class Composer>
2040 Composer *composer)
const;
2042 template <
class Composer>
2043 bool _GetSpecialPropMetadataImpl(
const UsdObject &obj,
2047 Composer *composer)
const;
2048 template <
class Composer>
2049 bool _GetMetadataImpl(
const UsdObject &obj,
2052 bool includeFallbacks,
2053 Composer *composer)
const;
2055 template <
class Composer>
2056 bool _GetGeneralMetadataImpl(
const UsdObject &obj,
2059 bool includeFallbacks,
2060 Composer *composer)
const;
2066 const TfToken &keyPath,
bool useFallbacks)
const;
2069 _ListMetadataFields(
const UsdObject &obj,
bool useFallbacks)
const;
2071 void _GetAllMetadata(
const UsdObject &obj,
2073 UsdMetadataValueMap* result,
2074 bool anchorAssetPathsOnly =
false)
const;
2084 template <
class T>
struct _ExtraResolveInfo;
2090 _ExtraResolveInfo<T> *extraInfo =
nullptr)
const;
2092 template <
class T>
struct _ResolveInfoResolver;
2093 struct _PropertyStackResolver;
2095 template <
class Resolver>
2096 void _GetResolvedValueImpl(
const UsdProperty &prop,
2109 Usd_InterpolatorBase* interpolator,
2113 _GetLayerWithStrongestValue(
2132 Usd_InterpolatorBase* interpolator,
2145 bool _GetTimeSamplesInInterval(
const UsdAttribute &attr,
2147 std::vector<double>* times)
const;
2149 bool _GetTimeSamplesInIntervalFromResolveInfo(
2153 std::vector<double>* times)
const;
2155 size_t _GetNumTimeSamples(
const UsdAttribute &attr)
const;
2157 size_t _GetNumTimeSamplesFromResolveInfo(
const UsdResolveInfo &info,
2163 bool _GetBracketingTimeSamples(
const UsdAttribute &attr,
2168 bool* hasSamples)
const;
2170 bool _GetBracketingTimeSamplesFromResolveInfo(
const UsdResolveInfo &info,
2176 bool* hasSamples)
const;
2178 bool _ValueMightBeTimeVarying(
const UsdAttribute &attr)
const;
2180 bool _ValueMightBeTimeVaryingFromResolveInfo(
const UsdResolveInfo &info,
2183 void _RegisterPerLayerNotices();
2184 void _RegisterResolverChangeNotice();
2189 Usd_PrimDataPtr _pseudoRoot;
2200 bool _editTargetIsLocalLayer;
2202 std::unique_ptr<PcpCache> _cache;
2203 std::unique_ptr<Usd_ClipCache> _clipCache;
2204 std::unique_ptr<Usd_InstanceCache> _instanceCache;
2206 TfHashMap<TfToken, TfToken, TfHash> _invalidPrimTypeToFallbackMap;
2208 size_t _usedLayersRevision;
2215 inline size_t hash(
SdfPath const &path)
const {
2216 return path.GetHash();
2219 using PathToNodeMap = tbb::concurrent_hash_map<
2220 SdfPath, Usd_PrimDataIPtr, _TbbHashEq>;
2221 PathToNodeMap _primMap;
2226 typedef std::vector<
2227 std::pair<SdfLayerHandle, TfNotice::Key> > _LayerAndNoticeKeyVec;
2228 _LayerAndNoticeKeyVec _layersAndNoticeKeys;
2229 size_t _lastChangeSerialNumber;
2234 class _PendingChanges;
2235 _PendingChanges* _pendingChanges;
2237 boost::optional<WorkDispatcher> _dispatcher;
2241 char const *_mallocTagID;
2252 bool _isClosingStage;
2253 bool _isWritingFallbackPrimTypes;
2267 friend class Usd_FlattenAccess;
2268 friend class Usd_PcpCacheAccess;
2269 friend class Usd_PrimData;
2270 friend class Usd_StageOpenRequest;
2271 template <
class T>
friend struct Usd_AttrGetValueHelper;
2272 friend struct Usd_AttrGetUntypedValueHelper;
2273 template <
class RefsOrPayloadsEditorType,
class RefsOrPayloadsProxyType>
2274 friend struct Usd_ListEditImpl;
2283 UsdStage::_GetTypeSpecificResolvedMetadata(
const UsdObject &obj,
2289 template<
typename T>
2303 " match retrieved type %s",
2304 ArchGetDemangled<T>().c_str(),
2311 template<
typename T>
2319 template<
typename T>
2333 TF_CODING_ERROR(
"Requested type %s for stage metadatum %s[%s] does not" 2334 " match retrieved type %s",
2335 ArchGetDemangled<T>().c_str(),
2343 template<
typename T>
2346 const T& value)
const 2354 typename std::enable_if<
2355 !UsdStage::_HasTypeSpecificResolution<T>::value,
bool>::type
2356 UsdStage::_GetMetadata(
const UsdObject &obj,
2365 return _GetStrongestResolvedMetadata(
2366 obj, fieldName, keyPath, useFallbacks, &out);
2371 typename std::enable_if<
2372 UsdStage::_HasTypeSpecificResolution<T>::value,
bool>::type
2373 UsdStage::_GetMetadata(
const UsdObject &obj,
2381 return _GetTypeSpecificResolvedMetadata(
2382 obj, fieldName, keyPath, useFallbacks, result);
2388 typename std::enable_if<!UsdStage::_IsEditTargetMappable<T>::value,
bool>::type
2390 const TfToken &keyPath,
const T& value)
2395 return _SetMetadataImpl<SdfAbstractDataConstValue>(
2396 object, key, keyPath, in);
2401 typename std::enable_if<UsdStage::_IsEditTargetMappable<T>::value,
bool>::type
2403 const TfToken &keyPath,
const T& value)
2405 return _SetEditTargetMappedMetadata(
object, key, keyPath, value);
2409 PXR_NAMESPACE_CLOSE_SCOPE
2411 #endif //PXR_USD_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.
Handle-object returned by TfNotice::Register().
A scene description container that can combine with other such containers to form simple component as...
USD_API void SetStartTimeCode(double)
Sets the stage's start timeCode.
USD_API UsdPrimRange Traverse()
Traverse the active, loaded, defined, non-abstract prims on this stage depth-first.
USD_API UsdPrim GetPrimAtPath(const SdfPath &path) const
Return the UsdPrim at path, or an invalid UsdPrim if none exists.
USD_API ArResolverContext GetPathResolverContext() const
Return the path resolver context for all path resolution during composition of this stage.
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 SdfLayerRefPtr Flatten(bool addSourceFileComment=true) const
Returns a single, anonymous, merged layer for this composite scene.
USD_API UsdPrim GetDefaultPrim() const
Return the root UsdPrim on this stage whose name is the root layer's defaultPrim metadata's value.
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
USD_API void SetLoadRules(UsdStageLoadRules const &rules)
Set the UsdStageLoadRules to govern payload inclusion on this stage.
Standard pointer typedefs.
USD_API void SetDefaultPrim(const UsdPrim &prim)
Set the default prim layer metadata in this stage's root layer.
T const & UncheckedGet() const &
Returns a const reference to the held object if the held object is of type T.
USD_API void SetInterpolationType(UsdInterpolationType interpolationType)
Sets the interpolation type used during value resolution for all attributes on this stage.
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...
The fully-typed container for a field value in an SdfAbstractData.
USD_API UsdObject GetObjectAtPath(const SdfPath &path) const
Return the UsdObject at path, or an invalid UsdObject if none exists.
USD_API UsdPrim OverridePrim(const SdfPath &path)
Attempt to ensure a UsdPrim at path exists 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 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 void LoadAndUnload(const SdfPathSet &loadSet, const SdfPathSet &unloadSet, UsdLoadPolicy policy=UsdLoadWithDescendants)
Unload and load the given path sets.
USD_API SdfLayerHandleVector GetLayerStack(bool includeSessionLayers=true) const
Return this stage's local layers in strong-to-weak order.
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 ...
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.
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.
USD_API std::vector< UsdPrim > GetPrototypes() const
Returns all native instancing prototype prims.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
USD_API void SetTimeCodesPerSecond(double timeCodesPerSecond) const
Sets the stage's timeCodesPerSecond value.
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 bool IsSupportedFile(const std::string &filePath)
Indicates whether the specified file is supported by UsdStage.
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
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.
VT_API std::string GetTypeName() const
Return the type name of the held typeid.
Load a prim plus all its descendants.
A proxy class for applying listOp edits to the inherit paths list for a prim.
USD_API void Save()
Calls SdfLayer::Save on all dirty layers contributing to this stage except session layers and sublaye...
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(...
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,...
USD_API SdfAssetPath GetColorConfiguration() const
Returns the default color configuration used to interpret the per- attribute color-spaces in the comp...
SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check...
UsdStagePopulationMask GetPopulationMask() const
Return this stage's population mask.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
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 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 UnmuteLayer(const std::string &layerIdentifier)
Unmute the layer identified by layerIdentifier if it had previously been muted.
USD_API double GetTimeCodesPerSecond() const
Returns the stage's timeCodesPerSecond value.
Value type that represents a time code.
USD_API const std::vector< std::string > & GetMutedLayers() const
Returns a vector of all layers that have been muted on this stage.
A UsdVariantSet represents a single VariantSet in USD (e.g.
USD_API bool HasAuthoredTimeCodeRange() const
Returns true if the stage has both start and end timeCodes authored in the session layer or the root ...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
USD_API const UsdEditTarget & GetEditTarget() const
Return the stage's EditTarget.
USD_API bool RemovePrim(const SdfPath &path)
Remove all scene description for the given path and its subtree in the current UsdEditTarget.
USD_API UsdProperty GetPropertyAtPath(const SdfPath &path) const
Return the UsdProperty at path, or an invalid UsdProperty if none exists.
USD_API double GetStartTimeCode() const
Returns the stage's start timeCode.
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...
The fully-typed container for a field value in an SdfAbstractData.
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.
USD_API UsdPrim GetPseudoRoot() const
Return the stage's "pseudo-root" prim, whose name is defined by Usd.
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.
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
USD_API double GetFramesPerSecond() const
Returns the stage's framesPerSecond value.
USD_API SdfPathSet GetLoadSet()
Returns a set of all loaded paths.
std::vector< TfToken > TfTokenVector
Convenience types.
Notice sent when asset paths may resolve to a different path than before due to a change in the resol...
A basic mathematical interval class.
USD_API double GetEndTimeCode() const
Returns the stage's end timeCode.
USD_API SdfLayerHandle GetSessionLayer() const
Return this stage's root session layer.
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.
USD_API bool HasDefaultPrim() const
Return true if this stage's root layer has an authored opinion for the default prim layer metadata.
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
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.
SdfVariability
An enum that identifies variability types for attributes.
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
Resolve the requested dictionary sub-element keyPath of dictionary-valued metadatum named key,...
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.
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 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 SetEndTimeCode(double)
Sets the stage's end timeCode.
UsdLoadPolicy
Controls UsdStage::Load() and UsdPrim::Load() behavior regarding whether or not descendant prims are ...
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 SdfLayerHandleVector GetUsedLayers(bool includeClipLayers=true) const
Return a vector of all of the layers currently consumed by this stage, as determined by the compositi...
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...
USD_API UsdRelationship GetRelationshipAtPath(const SdfPath &path) const
Return the UsdAttribute at path, or an invalid UsdAttribute if none exists.
SdfSpecType
An enum that specifies the type of an object.
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
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 bool ClearMetadataByDictKey(const TfToken &key, const TfToken &keyPath) const
Clear any authored value identified by key and keyPath at the current EditTarget.
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 void Reload()
Calls SdfLayer::Reload on all layers contributing to this stage, except session layers and sublayers ...
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.
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 SetFramesPerSecond(double framesPerSecond) const
Sets the stage's framesPerSecond value.
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.
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 void WriteFallbackPrimTypes()
Writes the fallback prim types defined in the schema registry to the stage as dictionary valued fallb...
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 void SetColorManagementSystem(const TfToken &cms) const
Sets the name of the color management system used to interpret the color configuration file pointed a...
UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim.
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
USD_API SdfLayerHandle GetRootLayer() const
Return this stage's root layer.
bool IsHolding() const
Return true if this value is holding an object of type T, false otherwise.
UsdStageLoadRules const & GetLoadRules() const
Return the stage's current UsdStageLoadRules governing payload inclusion.
static USD_API PcpVariantFallbackMap GetGlobalVariantFallbacks()
Get the global variant fallback preferences used in new UsdStages.
USD_API UsdInterpolationType GetInterpolationType() const
Returns the interpolation type used during value resolution for all attributes on this stage.
Enable a concrete base class for use with TfWeakPtr.
USD_API void ClearDefaultPrim()
Clear the default prim layer metadata in this stage's root layer.
char const * GetText() const
Return the text that this token represents.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
USD_API UsdAttribute GetAttributeAtPath(const SdfPath &path) const
Return the UsdAttribute at path, or an invalid UsdAttribute if none exists.
This class represents a mask that may be applied to a UsdStage to limit the set of UsdPrim s it popul...
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
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 UsdEditTarget GetEditTargetForLocalLayer(size_t i)
Return a UsdEditTarget for editing the layer at index i in the layer stack.