24#ifndef PXR_USD_SDF_LAYER_H
25#define PXR_USD_SDF_LAYER_H
30#include "pxr/usd/sdf/api.h"
31#include "pxr/usd/sdf/data.h"
33#include "pxr/usd/sdf/identity.h"
34#include "pxr/usd/sdf/layerHints.h"
37#include "pxr/usd/sdf/path.h"
38#include "pxr/usd/sdf/proxyTypes.h"
41#include "pxr/usd/ar/ar.h"
45#include "pxr/base/vt/value.h"
48#include <boost/optional.hpp>
57PXR_NAMESPACE_OPEN_SCOPE
148 const std::string &identifier,
162 const std::string &identifier,
174 const std::string &identifier,
189 const SdfLayerHandle &anchor,
190 const std::string &identifier,
201 const std::string &identifier,
216 const SdfLayerHandle &anchor,
217 const std::string &identifier,
235 const std::string &layerPath,
236 bool metadataOnly =
false,
237 const std::string& tag = std::string());
296 const std::string& tag = std::string(),
302 const std::string &tag,
const SdfFileFormatConstPtr &format,
318 const std::string& identifier);
329 bool Save(
bool force =
false)
const;
345 const std::string& comment = std::string(),
411 bool Import(
const std::string &layerPath);
426 const std::string &oldAssetPath,
427 const std::string &newAssetPath=std::string());
450 const std::string &oldAssetPath,
451 const std::string &newAssetPath=std::string());
488 const std::string& identifier,
489 std::string* layerPath,
495 const std::string& layerPath,
630 if (std::is_same<T, SdfValueBlock>::value) {
631 return hasValue && outValue.isValueBlock;
634 return hasValue && (!outValue.isValueBlock);
641 return _data->GetTypeid(path, name);
664 const TfToken &keyPath, T* value)
const
681 const TfToken& fieldName)
const;
687 const TfToken& fieldName,
const T& defaultValue = T())
const
689 return _data->GetAs<T>(path, fieldName, defaultValue);
1019 void ClearSessionOwner();
1284 bool IncludedAll()
const {
return _includeAll; }
1285 const std::vector<std::string>& GetIncluded()
const {
return _include; }
1286 const std::vector<std::string>& GetExcluded()
const {
return _exclude; }
1301 std::vector<std::string> _include;
1302 std::vector<std::string> _exclude;
1303 bool _includeAll =
false;
1513 std::set<double> ListAllTimeSamples()
const;
1517 ListTimeSamplesForPath(
const SdfPath& path)
const;
1520 bool GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper);
1523 size_t GetNumTimeSamplesForPath(
const SdfPath& path)
const;
1526 bool GetBracketingTimeSamplesForPath(
const SdfPath& path,
1528 double* tLower,
double* tUpper);
1531 bool QueryTimeSample(
const SdfPath& path,
double time,
1534 bool QueryTimeSample(
const SdfPath& path,
double time,
1538 bool QueryTimeSample(
const SdfPath& path,
double time,
1542 return QueryTimeSample(path, time);
1546 const bool hasValue = QueryTimeSample(
1549 if (std::is_same<T, SdfValueBlock>::value) {
1550 return hasValue && outValue.isValueBlock;
1553 return hasValue && (!outValue.isValueBlock);
1557 void SetTimeSample(
const SdfPath& path,
double time,
1560 void SetTimeSample(
const SdfPath& path,
double time,
1564 void SetTimeSample(
const SdfPath& path,
double time,
1569 return SetTimeSample(path, time, untypedInValue);
1573 void EraseTimeSample(
const SdfPath& path,
double time);
1581 static void DumpLayerInfo();
1585 bool WriteDataFile(
const std::string &filename);
1592 SdfLayer(
const SdfFileFormatConstPtr& fileFormat,
1593 const std::string &identifier,
1594 const std::string &realPath = std::string(),
1597 bool validateAuthoring =
false);
1603 SdfFileFormatConstPtr fileFormat,
1604 const std::string& identifier,
1606 bool saveLayer =
true);
1609 const SdfFileFormatConstPtr &fileFormat,
1610 const std::string& identifier,
1611 const std::string& realPath,
1616 const SdfFileFormatConstPtr &fileFormat,
1617 const std::string& tag,
1623 void _FinishInitialization(
bool success);
1635 bool _WaitForInitializationAndCheckIfSuccessful();
1639 bool _ShouldNotify()
const;
1647 bool _UpdateLastDirtinessState()
const;
1657 bool _CanGetSpecAtPath(
const SdfPath& path,
1663 void _InitializeFromIdentifier(
1664 const std::string &identifier,
1665 const std::string &realPath = std::string(),
1666 const std::string &fileVersion = std::string(),
1671 struct _FindOrOpenLayerInfo;
1672 static bool _ComputeInfoToFindOrOpenLayer(
1673 const std::string& identifier,
1675 _FindOrOpenLayerInfo* info,
1676 bool computeAssetInfo =
false);
1681 template <
class Lock>
1684 const _FindOrOpenLayerInfo& info,
1692 template <
class ScopedLock>
1694 _Find(
const std::string &identifier,
1696 ScopedLock &lock,
bool retryAsWriter);
1706 template <
class ScopedLock>
1708 _TryToFindLayer(
const std::string &identifier,
1710 ScopedLock &lock,
bool retryAsWriter);
1719 bool _IsInert(
const SdfPath &path,
bool ignoreChildren,
1720 bool requiredFieldOnlyPropertiesAreInert =
false)
const;
1725 bool _IsInertSubtree(
const SdfPath &path)
const;
1732 void _RemoveIfInert(
const SdfSpec& spec);
1738 bool _RemoveInertDFS(SdfPrimSpecHandle prim);
1742 void _RemoveInertToRootmost(SdfPrimSpecHandle prim);
1745 bool _ValidateAuthoring()
const {
return _validateAuthoring; }
1748 std::string _GetMutedPath()
const;
1752 void _UpdatePrimCompositionDependencyPaths(
1753 const SdfPrimSpecHandle &parent,
1754 const std::string &oldLayerPath,
1755 const std::string &newLayerPath);
1758 void _MarkCurrentStateAsClean()
const;
1763 _GetRequiredFieldDef(
const SdfPath &path,
1775 static std::vector<TfToken>
1796 void _SetValue(
const TfToken& key, T value);
1800 T _GetValue(
const TfToken& key)
const;
1802 enum _ReloadResult { _ReloadFailed, _ReloadSucceeded, _ReloadSkipped };
1803 _ReloadResult _Reload(
bool force);
1807 bool _Read(
const std::string& identifier,
1814 bool _Save(
bool force)
const;
1822 bool _WriteToFile(
const std::string& newFileName,
1823 const std::string& comment,
1824 SdfFileFormatConstPtr fileFormat = TfNullPtr,
1830 void _SwapData(SdfAbstractDataRefPtr &data);
1834 void _AdoptData(
const SdfAbstractDataRefPtr &newData);
1843 void _SetData(
const SdfAbstractDataPtr &newData,
1847 SdfAbstractDataConstPtr _GetData()
const;
1850 SdfAbstractDataRefPtr _CreateData()
const;
1858 void _PrimSetField(
const SdfPath& path,
1862 bool useDelegate =
true);
1870 void _PrimSetFieldDictValueByKey(
const SdfPath& path,
1875 bool useDelegate =
true);
1879 void _PrimPushChild(
const SdfPath& parentPath,
1882 bool useDelegate =
true);
1884 void _PrimPopChild(
const SdfPath& parentPath,
1886 bool useDelegate =
true);
1894 void _PrimMoveSpec(
const SdfPath &oldPath,
const SdfPath &newPath,
1895 bool useDelegate =
true);
1903 bool _DeleteSpec(
const SdfPath &path);
1907 bool useDelegate =
true);
1910 void _PrimDeleteSpec(
const SdfPath &path,
bool inert,
1911 bool useDelegate =
true);
1915 void _PrimSetTimeSample(
const SdfPath& path,
double time,
1917 bool useDelegate =
true);
1921 template <
typename ChildPolicy>
1925 SdfLayerHandle _self;
1928 SdfFileFormatConstPtr _fileFormat;
1937 mutable Sdf_IdentityRegistry _idRegistry;
1940 SdfAbstractDataRefPtr _data;
1943 SdfLayerStateDelegateBaseRefPtr _stateDelegate;
1955 std::atomic<bool> _initializationComplete;
1959 boost::optional<bool> _initializationWasSuccessful;
1962 mutable bool _lastDirtyState;
1965 std::unique_ptr<Sdf_AssetInfo> _assetInfo;
1968 mutable VtValue _assetModificationTime;
1975 mutable size_t _mutedLayersRevisionCache;
1979 mutable bool _isMutedCache;
1982 bool _permissionToEdit;
1983 bool _permissionToSave;
1986 bool _validateAuthoring;
1996 friend class Sdf_ChangeManager;
1999 template <
class ChildPolicy>
friend class Sdf_ChildrenUtils;
2011PXR_NAMESPACE_CLOSE_SCOPE
Contains information about a resolved asset.
Represents a resolved asset path.
The fully-typed container for a field value in an SdfAbstractData.
A type-erased container for a const field value in an SdfAbstractData.
Interface for scene description data storage.
The fully-typed container for a field value in an SdfAbstractData.
A type-erased container for a field value in an SdfAbstractData.
Contains an asset path and an optional resolved path.
A subclass of SdfPropertySpec that holds typed data.
A description of an arbitrarily complex namespace edit.
Provides a view onto an object's children.
SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check...
Object used to specify detached layers.
DetachedLayerRules & IncludeAll()
Include all layers in the detached layer set.
SDF_API DetachedLayerRules & Include(const std::vector< std::string > &patterns)
Include layers whose identifiers contain any of the strings in patterns in the detached layer set.
SDF_API DetachedLayerRules & Exclude(const std::vector< std::string > &patterns)
Exclude layers whose identifiers contain any of the strings in patterns from the detached layer set.
DetachedLayerRules()=default
A default constructed rules object Excludes all layers from the detached layer set.
SDF_API bool IsIncluded(const std::string &identifier) const
Returns true if identifier is included in the detached layer set, false otherwise.
Contains hints about layer contents that may be used to accelerate certain composition operations.
A scene description container that can combine with other such containers to form simple component as...
SDF_API void RemoveFromRootPrimOrderByIndex(int index)
Removes a root prim name from the root prim order by index.
SDF_API bool Import(const std::string &layerPath)
Imports the content of the given layer path, replacing the content of the current layer.
bool HasField(const SdfPath &path, const TfToken &name, T *value) const
Returns true if the object has a non-empty value with name name and type T.
SDF_API TfToken GetColorManagementSystem() const
Returns the color management system used to interpret the color configuration asset-path authored in ...
static SDF_API void RemoveFromMutedLayers(const std::string &mutedPath)
Remove the specified path from the muted layers set.
SDF_API bool IsMuted() const
Returns true if the current layer is muted.
SDF_API double GetEndTimeCode() const
Returns the layer's end timeCode.
SDF_API void ClearCustomLayerData()
Clears out the CustomLayerData dictionary associated with this layer.
SDF_API void ClearTimeCodesPerSecond()
Clear the timeCodesPerSecond opinion.
SDF_API SdfSubLayerProxy GetSubLayerPaths() const
Returns a proxy for this layer's sublayers.
SDF_API std::set< std::string > GetCompositionAssetDependencies() const
Return paths of all assets this layer depends on due to composition fields.
SDF_API bool StreamsData() const
Returns true if this layer streams data from its serialized data store on demand, false otherwise.
SDF_API void SetFieldDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, const VtValue &value)
Set the value of the given path and fieldName.
SDF_API void InsertInRootPrimOrder(const TfToken &name, int index=-1)
Adds a new root prim name in the root prim order.
static SDF_API void AddToMutedLayers(const std::string &mutedPath)
Add the specified path to the muted layers set.
SDF_API void SetFramesPerSecond(double framesPerSecond)
Sets the layer's frames per second.
SDF_API bool UpdateCompositionAssetDependency(const std::string &oldAssetPath, const std::string &newAssetPath=std::string())
Updates the asset path of a composation dependency in this layer.
virtual SDF_API ~SdfLayer()
Destructor.
static SDF_API SdfLayerRefPtr CreateAnonymous(const std::string &tag, const SdfFileFormatConstPtr &format, const FileFormatArguments &args=FileFormatArguments())
Create an anonymous layer with a specific format.
SDF_API bool HasFramePrecision() const
Returns true if the layer has a frames precision opinion.
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
SDF_API bool HasSessionOwner() const
Returns true if the layer has a session owner opinion.
SDF_API SdfNameOrderProxy GetRootPrimOrder() const
Returns the list of prim names for this layer's reorder rootPrims statement.
SDF_API bool IsDirty() const
Returns true if the layer is dirty, i.e.
SDF_API bool HasSpec(const SdfPath &path) const
Return whether a spec exists at path.
SDF_API bool ImportFromString(const std::string &string)
Reads this layer from the given string.
SDF_API void SetFramePrecision(int framePrecision)
Sets the layer's frame precision.
SDF_API std::vector< TfToken > ListFields(const SdfPath &path) const
Return the names of all the fields that are set at path.
static SDF_API SdfLayerHandle FindRelativeToLayer(const SdfLayerHandle &anchor, const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Return an existing layer with the given identifier and args.
SDF_API SdfNamespaceEditDetail::Result CanApply(const SdfBatchNamespaceEdit &, SdfNamespaceEditDetailVector *details=NULL) const
Check if a batch of namespace edits will succeed.
SDF_API SdfDataRefPtr GetMetadata() const
Returns the data from the absolute root path of this layer.
SDF_API const SdfSchemaBase & GetSchema() const
Returns the schema this layer adheres to.
SDF_API void SetPermissionToEdit(bool allow)
Sets permission to edit.
static SDF_API bool IsMuted(const std::string &path)
Returns true if the specified layer path is muted.
SDF_API bool IsEmpty() const
Returns whether this layer has no significant data.
SDF_API std::string GetOwner() const
Returns the layer's owner.
SDF_API void EraseField(const SdfPath &path, const TfToken &fieldName)
Remove the field at path and fieldName, if one exists.
SDF_API int GetFramePrecision() const
Returns the layer's frame precision.
SDF_API void SetPermissionToSave(bool allow)
Sets permission to save.
void SetFieldDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, const T &val)
Set the value of the given path and fieldName.
SDF_API bool HasFramesPerSecond() const
Returns true if the layer has a frames per second opinion.
SDF_API bool HasOwner() const
Returns true if the layer has an owner opinion.
SDF_API void SetField(const SdfPath &path, const TfToken &fieldName, const VtValue &value)
Set the value of the given path and fieldName.
static SDF_API bool SplitIdentifier(const std::string &identifier, std::string *layerPath, FileFormatArguments *arguments)
Splits the given layer identifier into its constituent layer path and arguments.
SDF_API void ClearEndTimeCode()
Clear the endTimeCode opinion.
SDF_API const ArResolvedPath & GetResolvedPath() const
Returns the resolved path for this layer.
static SDF_API bool IsAnonymousLayerIdentifier(const std::string &identifier)
Returns true if the identifier is an anonymous layer unique identifier.
SDF_API void SetCustomLayerData(const VtDictionary &value)
Sets the CustomLayerData dictionary associated with this layer.
SDF_API void SetIdentifier(const std::string &identifier)
Sets the layer identifier.
SDF_API bool GetHasOwnedSubLayers() const
Returns true if the layer's sublayers are expected to have owners.
static SDF_API SdfLayerRefPtr OpenAsAnonymous(const std::string &layerPath, bool metadataOnly=false, const std::string &tag=std::string())
Load the given layer from disk as a new anonymous layer.
SDF_API const std::string & GetIdentifier() const
Returns the layer identifier.
static SDF_API SdfLayerHandleSet GetLoadedLayers()
Returns handles for all layers currently held by the layer registry.
SDF_API const std::string & GetRepositoryPath() const
Returns the layer identifier in asset path form.
SDF_API void ScheduleRemoveIfInert(const SdfSpec &spec)
Cause spec to be removed if it no longer affects the scene when the last change block is closed,...
SDF_API void SetSessionOwner(const std::string &owner)
Sets the layer's session owner.
SDF_API VtDictionary GetCustomLayerData() const
Returns the CustomLayerData dictionary associated with this layer.
SDF_API bool HasCustomLayerData() const
Returns true if CustomLayerData is authored on the layer.
SDF_API void RemovePrimIfInert(SdfPrimSpecHandle prim)
Removes scene description that does not affect the scene in the layer namespace beginning with prim.
static SDF_API SdfLayerRefPtr CreateNew(const SdfFileFormatConstPtr &fileFormat, const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Creates a new empty layer with the given identifier for a given file format class.
SDF_API void SetRootPrims(const SdfPrimSpecHandleVector &rootPrims)
Sets a new vector of root prims.
SDF_API void SetColorManagementSystem(const TfToken &cms)
Sets the color management system used to interpret the color configuration asset-path authored this l...
SDF_API SdfLayerOffsetVector GetSubLayerOffsets() const
Returns the layer offsets for all the subLayer paths.
SDF_API size_t GetNumSubLayerPaths() const
Returns the number of sublayer paths (and offsets).
SDF_API bool HasDefaultPrim()
Return true if the default prim metadata is set in this layer.
SDF_API SdfPrimSpecHandle GetPseudoRoot() const
Returns the layer's pseudo-root prim.
SDF_API std::string GetDocumentation() const
Returns the documentation string for this layer.
SDF_API const FileFormatArguments & GetFileFormatArguments() const
Returns the file format-specific arguments used during the construction of this layer.
SDF_API void ClearStartTimeCode()
Clear the startTimeCode opinion.
SDF_API bool UpdateExternalReference(const std::string &oldAssetPath, const std::string &newAssetPath=std::string())
SDF_API bool HasEndTimeCode() const
Returns true if the layer has an endTimeCode opinion.
SDF_API const std::string & GetRealPath() const
Returns the resolved path for this layer.
SDF_API void RemovePropertyIfHasOnlyRequiredFields(SdfPropertySpecHandle prop)
Removes prop if it has only required fields (i.e.
SDF_API bool PermissionToSave() const
Returns true if the caller is allowed to save the layer to its existing fileName and false otherwise.
SDF_API bool HasFieldDictKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, VtValue *value=NULL) const
Return whether a value exists for the given path and fieldName and keyPath.
SDF_API double GetFramesPerSecond() const
Returns the layer's frames per second.
SDF_API SdfSpecHandle GetObjectAtPath(const SdfPath &path)
Returns the object at the given path.
SDF_API SdfLayerOffset GetSubLayerOffset(int index) const
Returns the layer offset for the subLayer path at the given index.
std::type_info const & GetFieldTypeid(const SdfPath &path, const TfToken &name) const
Return the type of the value for name on spec path.
SDF_API bool HasColorManagementSystem() const
Returns true if colorManagementSystem metadata is set in this layer.
SDF_API bool HasField(const SdfPath &path, const TfToken &fieldName, VtValue *value=NULL) const
Return whether a value exists for the given path and fieldName.
SDF_API VtValue GetField(const SdfPath &path, const TfToken &fieldName) const
Return the value for the given path and fieldName.
SDF_API bool IsDetached() const
Returns true if this layer is detached from its serialized data store, false otherwise.
SDF_API SdfPrimSpecHandle GetPrimAtPath(const SdfPath &path)
Returns the prim at the given path.
SDF_API void RemoveFromRootPrimOrder(const TfToken &name)
Removes a root prim name from the root prim order.
SDF_API bool PermissionToEdit() const
Returns true if the caller is allowed to modify the layer and false otherwise.
SDF_API VtDictionary GetExpressionVariables() const
Returns the expression variables dictionary authored on this layer.
SDF_API void SetRootPrimOrder(const std::vector< TfToken > &names)
Given a list of (possible sparse) prim names, authors a reorder rootPrims statement for this prim.
SDF_API void ClearFramesPerSecond()
Clear the framesPerSecond opinion.
static SDF_API const DetachedLayerRules & GetDetachedLayerRules()
Returns the current rules for the detached layer set.
SDF_API void UpdateAssetInfo()
Update layer asset information.
SDF_API bool HasStartTimeCode() const
Returns true if the layer has a startTimeCode opinion.
static SDF_API SdfLayerRefPtr CreateAnonymous(const std::string &tag=std::string(), const FileFormatArguments &args=FileFormatArguments())
Creates a new anonymous layer with an optional tag.
SDF_API SdfPropertySpecHandle GetPropertyAtPath(const SdfPath &path)
Returns a property at the given path.
SDF_API void ClearColorConfiguration()
Clears the color configuration metadata authored in this layer.
SDF_API double GetTimeCodesPerSecond() const
Returns the layer's timeCodes per second.
SDF_API bool IsAnonymous() const
Returns true if this layer is an anonymous layer.
SDF_API const VtValue & GetAssetInfo() const
Returns resolve information from the last time the layer identifier was resolved.
SDF_API SdfAssetPath GetColorConfiguration() const
Returns the color configuration asset-path for this layer.
SDF_API bool Apply(const SdfBatchNamespaceEdit &)
Performs a batch of namespace edits.
SDF_API std::set< std::string > GetExternalReferences() const
SDF_API bool ExportToString(std::string *result) const
Writes this layer to the given string.
SDF_API void Clear()
Clears the layer of all content.
SDF_API void SetColorConfiguration(const SdfAssetPath &colorConfiguration)
Sets the color configuration asset-path for this layer.
SDF_API std::string GetFileExtension() const
Returns the file extension to use for this layer.
static SDF_API std::string CreateIdentifier(const std::string &layerPath, const FileFormatArguments &arguments)
Joins the given layer path and arguments into an identifier.
SDF_API void SetOwner(const std::string &owner)
Sets the layer's owner.
SDF_API RootPrimsView GetRootPrims() const
Returns a vector of the layer's root prims.
SDF_API void SetExpressionVariables(const VtDictionary &expressionVars)
Sets the expression variables dictionary for this layer.
SDF_API TfToken GetDefaultPrim() const
Return the defaultPrim metadata for this layer.
SDF_API SdfLayerHints GetHints() const
Return hints about the layer's current contents.
SDF_API void SetDocumentation(const std::string &documentation)
Sets the documentation string for this layer.
static SDF_API SdfLayerRefPtr FindOrOpen(const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Return an existing layer with the given identifier and args, or else load it.
SDF_API std::string GetComment() const
Returns the comment string for this layer.
static SDF_API bool ReloadLayers(const std::set< SdfLayerHandle > &layers, bool force=false)
Reloads the specified layers.
SDF_API void RemoveRootPrim(const SdfPrimSpecHandle &prim)
Remove a root prim.
SDF_API bool HasExpressionVariables() const
Returns true if expression variables are authored on this layer.
SDF_API void ClearExpressionVariables()
Clears the expression variables dictionary authored on this layer.
T GetFieldAs(const SdfPath &path, const TfToken &fieldName, const T &defaultValue=T()) const
Return the value for the given path and fieldName.
SDF_API bool InsertRootPrim(const SdfPrimSpecHandle &prim, int index=-1)
Adds a new root prim at the given index.
SDF_API void SetEndTimeCode(double endTimeCode)
Sets the layer's end timeCode.
static SDF_API SdfLayerRefPtr CreateNew(const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Creates a new empty layer with the given identifier.
SDF_API bool Reload(bool force=false)
Reloads the layer from its persistent representation.
SDF_API void ClearColorManagementSystem()
Clears the 'colorManagementSystem' metadata authored in this layer.
SDF_API void InsertSubLayerPath(const std::string &path, int index=-1)
Inserts new sublayer path at the given index.
SDF_API const SdfFileFormatConstPtr & GetFileFormat() const
Returns the file format used by this layer.
void SetField(const SdfPath &path, const TfToken &fieldName, const T &val)
Set the value of the given path and fieldName.
SDF_API void SetMuted(bool muted)
Mutes the current layer if muted is true, and unmutes it otherwise.
SDF_API void SetStateDelegate(const SdfLayerStateDelegateBaseRefPtr &delegate)
Sets the state delegate used to manage this layer's authoring state.
SDF_API void ApplyRootPrimOrder(std::vector< TfToken > *vec) const
Reorders the given list of prim names according to the reorder rootPrims statement for this layer.
SDF_API const std::string & GetAssetName() const
Returns the asset name associated with this layer.
SDF_API SdfLayerStateDelegateBasePtr GetStateDelegate() const
Returns the state delegate used to manage this layer's authoring state.
SDF_API void ClearDefaultPrim()
Clear the default prim metadata for this layer.
SDF_API bool HasColorConfiguration() const
Returns true if color configuration metadata is set in this layer.
static SDF_API std::set< std::string > GetMutedLayers()
Returns the set of muted layer paths.
SDF_API double GetStartTimeCode() const
Returns the layer's start timeCode.
SDF_API bool HasTimeCodesPerSecond() const
Returns true if the layer has a timeCodesPerSecond opinion.
SDF_API void SetSubLayerPaths(const std::vector< std::string > &newPaths)
Sets the paths of the layer's sublayers.
SDF_API std::string GetDisplayName() const
Returns the layer's display name.
static SDF_API SdfLayerHandle Find(const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Return an existing layer with the given identifier and args.
SDF_API void SetTimeCodesPerSecond(double timeCodesPerSecond)
Sets the layer's timeCodes per second.
SDF_API void SetComment(const std::string &comment)
Sets the comment string for this layer.
SDF_API void RemoveSubLayerPath(int index)
Removes sublayer path at the given index.
SDF_API std::string ComputeAbsolutePath(const std::string &assetPath) const
Returns the path to the asset specified by assetPath using this layer to anchor the path if necessary...
SDF_API void SetDefaultPrim(const TfToken &name)
Set the default prim metadata for this layer.
SDF_API SdfAttributeSpecHandle GetAttributeAtPath(const SdfPath &path)
Returns an attribute at the given path.
SDF_API void ClearFramePrecision()
Clear the framePrecision opinion.
SDF_API VtValue GetFieldDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath) const
Return the value for the given path and fieldName at keyPath.
SDF_API bool Save(bool force=false) const
Returns true if successful, false if an error occurred.
bool HasFieldDictKey(const SdfPath &path, const TfToken &name, const TfToken &keyPath, T *value) const
Returns true if the object has a non-empty value with name name and keyPath and type T.
static SDF_API void SetDetachedLayerRules(const DetachedLayerRules &mask)
Sets the rules specifying detached layers.
SDF_API std::set< std::string > GetExternalAssetDependencies() const
Returns a set of resolved paths to all external asset dependencies the layer needs to generate its co...
SDF_API void SetStartTimeCode(double startTimecode)
Sets the layer's start timeCode.
SDF_API void RemoveInertSceneDescription()
Removes all scene description in this layer that does not affect the scene.
static SDF_API SdfLayerRefPtr FindOrOpenRelativeToLayer(const SdfLayerHandle &anchor, const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Return an existing layer with the given identifier and args, or else load it.
SDF_API SdfSpecType GetSpecType(const SdfPath &path) const
Return the spec type for path.
SDF_API void TransferContent(const SdfLayerHandle &layer)
Copies the content of the given layer into this layer.
static SDF_API bool IsIncludedByDetachedLayerRules(const std::string &identifier)
Returns whether the given layer identifier is included in the current rules for the detached layer se...
SDF_API const std::string & GetVersion() const
Returns the asset system version of this layer.
static SDF_API std::string GetDisplayNameFromIdentifier(const std::string &identifier)
Returns the display name for the given identifier, using the same rules as GetDisplayName.
SDF_API bool Export(const std::string &filename, const std::string &comment=std::string(), const FileFormatArguments &args=FileFormatArguments()) const
Exports this layer to a file.
SDF_API void SetHasOwnedSubLayers(bool)
Sets whether the layer's sublayers are expected to have owners.
SDF_API std::string GetSessionOwner() const
Returns the layer's session owner.
SDF_API void EraseFieldDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath)
Remove the field at path and fieldName and keyPath, if one exists.
std::function< void(const SdfPath &)> TraversalFunction
Callback function for Traverse.
SdfLayer(const SdfLayer &)=delete
Noncopyable.
SDF_API void SetSubLayerOffset(const SdfLayerOffset &offset, int index)
Sets the layer offset for the subLayer path at the given index.
static SDF_API SdfLayerRefPtr New(const SdfFileFormatConstPtr &fileFormat, const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Creates a new empty layer with the given identifier for a given file format class.
SDF_API SdfRelationshipSpecHandle GetRelationshipAtPath(const SdfPath &path)
Returns a relationship at the given path.
SDF_API void ClearOwner()
Clear the owner opinion.
Represents a time offset and scale between layers.
Maintains authoring state information for an associated layer.
Represents a single list of list editing operations.
A path value used to locate objects in layers or scenegraphs.
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Class defining various attributes for a field.
Generic class that provides information about scene description fields but doesn't actually provide a...
Base class for all Sdf spec classes.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
Enable a concrete base class for use with TfWeakPtr.
A map with string keys and VtValue values.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
A work dispatcher runs concurrent tasks.
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
std::vector< SdfNamespaceEditDetail > SdfNamespaceEditDetailVector
A sequence of SdfNamespaceEditDetail.
Result
Validity of an edit.
SdfSpecType
An enum that specifies the type of an object.