7#ifndef PXR_USD_SDF_LAYER_H
8#define PXR_USD_SDF_LAYER_H
13#include "pxr/usd/sdf/api.h"
14#include "pxr/usd/sdf/data.h"
16#include "pxr/usd/sdf/identity.h"
17#include "pxr/usd/sdf/layerHints.h"
20#include "pxr/usd/sdf/path.h"
21#include "pxr/usd/sdf/proxyTypes.h"
24#include "pxr/usd/ar/ar.h"
28#include "pxr/base/vt/value.h"
39PXR_NAMESPACE_OPEN_SCOPE
131 const std::string &identifier,
145 const std::string &identifier,
157 const std::string &identifier,
172 const SdfLayerHandle &anchor,
173 const std::string &identifier,
184 const std::string &identifier,
199 const SdfLayerHandle &anchor,
200 const std::string &identifier,
218 const std::string &layerPath,
219 bool metadataOnly =
false,
220 const std::string& tag = std::string());
279 const std::string& tag = std::string(),
285 const std::string &tag,
const SdfFileFormatConstPtr &format,
301 const std::string& identifier);
312 bool Save(
bool force =
false)
const;
328 const std::string& comment = std::string(),
394 bool Import(
const std::string &layerPath);
409 const std::string &oldAssetPath,
410 const std::string &newAssetPath=std::string());
433 const std::string &oldAssetPath,
434 const std::string &newAssetPath=std::string());
471 const std::string& identifier,
472 std::string* layerPath,
478 const std::string& layerPath,
613 if (std::is_same<T, SdfValueBlock>::value) {
614 return hasValue && outValue.isValueBlock;
617 return hasValue && (!outValue.isValueBlock);
624 return _data->GetTypeid(path, name);
647 const TfToken &keyPath, T* value)
const
664 const TfToken& fieldName)
const;
670 const TfToken& fieldName,
const T& defaultValue = T())
const
672 return _data->GetAs<T>(path, fieldName, defaultValue);
1015 void ClearSessionOwner();
1311 bool IncludedAll()
const {
return _includeAll; }
1312 const std::vector<std::string>& GetIncluded()
const {
return _include; }
1313 const std::vector<std::string>& GetExcluded()
const {
return _exclude; }
1328 std::vector<std::string> _include;
1329 std::vector<std::string> _exclude;
1330 bool _includeAll =
false;
1540 std::set<double> ListAllTimeSamples()
const;
1549 bool GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper);
1561 double* tLower,
double* tUpper);
1589 if (std::is_same<T, SdfValueBlock>::value) {
1590 return hasValue && outValue.isValueBlock;
1593 return hasValue && (!outValue.isValueBlock);
1630 static void DumpLayerInfo();
1634 bool WriteDataFile(
const std::string &filename);
1647 const SdfLayerHandle& layer,
1648 bool processPropertyFields =
true)
const;
1653 SdfLayer(
const SdfFileFormatConstPtr& fileFormat,
1654 const std::string &identifier,
1655 const std::string &realPath = std::string(),
1658 bool validateAuthoring =
false);
1664 SdfFileFormatConstPtr fileFormat,
1665 const std::string& identifier,
1667 bool saveLayer =
true);
1670 const SdfFileFormatConstPtr &fileFormat,
1671 const std::string& identifier,
1672 const std::string& realPath,
1677 const SdfFileFormatConstPtr &fileFormat,
1678 const std::string& tag,
1684 void _FinishInitialization(
bool success);
1696 bool _WaitForInitializationAndCheckIfSuccessful();
1700 bool _ShouldNotify()
const;
1708 bool _UpdateLastDirtinessState()
const;
1718 bool _CanGetSpecAtPath(
const SdfPath& path,
1724 void _InitializeFromIdentifier(
1725 const std::string &identifier,
1726 const std::string &realPath = std::string(),
1727 const std::string &fileVersion = std::string(),
1732 struct _FindOrOpenLayerInfo;
1733 static bool _ComputeInfoToFindOrOpenLayer(
1734 const std::string& identifier,
1736 _FindOrOpenLayerInfo* info,
1737 bool computeAssetInfo =
false);
1742 template <
class Lock>
1745 const _FindOrOpenLayerInfo& info,
1753 template <
class ScopedLock>
1755 _Find(
const std::string &identifier,
1757 ScopedLock &lock,
bool retryAsWriter);
1767 template <
class ScopedLock>
1769 _TryToFindLayer(
const std::string &identifier,
1771 ScopedLock &lock,
bool retryAsWriter);
1780 bool _IsInert(
const SdfPath &path,
bool ignoreChildren,
1781 bool requiredFieldOnlyPropertiesAreInert =
false)
const;
1786 bool _IsInertSubtree(
const SdfPath &path)
const;
1793 void _RemoveIfInert(
const SdfSpec& spec);
1799 bool _RemoveInertDFS(SdfPrimSpecHandle prim);
1803 void _RemoveInertToRootmost(SdfPrimSpecHandle prim);
1806 bool _ValidateAuthoring()
const {
return _validateAuthoring; }
1809 std::string _GetMutedPath()
const;
1813 void _UpdatePrimCompositionDependencyPaths(
1814 const SdfPrimSpecHandle &parent,
1815 const std::string &oldLayerPath,
1816 const std::string &newLayerPath);
1819 void _MarkCurrentStateAsClean()
const;
1824 _GetRequiredFieldDef(
const SdfPath &path,
1836 static std::vector<TfToken>
1857 void _SetValue(
const TfToken& key, T value);
1861 T _GetValue(
const TfToken& key)
const;
1863 enum _ReloadResult { _ReloadFailed, _ReloadSucceeded, _ReloadSkipped };
1864 _ReloadResult _Reload(
bool force);
1868 bool _Read(
const std::string& identifier,
1875 bool _Save(
bool force)
const;
1883 bool _WriteToFile(
const std::string& newFileName,
1884 const std::string& comment,
1885 SdfFileFormatConstPtr fileFormat,
1890 void _SwapData(SdfAbstractDataRefPtr &data);
1894 void _AdoptData(
const SdfAbstractDataRefPtr &newData);
1901 template<
typename DeleteSpecFunc,
typename CreateSpecFunc,
1902 typename SetFieldFunc,
typename ErrorFunc>
1903 void _ProcessIncomingData(
const SdfAbstractDataPtr &newData,
1905 bool processPropertyFields,
1906 const DeleteSpecFunc &deleteSpecFunc,
1907 const CreateSpecFunc &createSpecFunc,
1908 const SetFieldFunc &setFieldFunc,
1909 const ErrorFunc &errorFunc)
const;
1918 void _SetData(
const SdfAbstractDataPtr &newData,
1922 SdfAbstractDataConstPtr _GetData()
const;
1925 SdfAbstractDataRefPtr _CreateData()
const;
1933 void _PrimSetField(
const SdfPath& path,
1937 bool useDelegate =
true);
1945 void _PrimSetFieldDictValueByKey(
const SdfPath& path,
1950 bool useDelegate =
true);
1954 void _PrimPushChild(
const SdfPath& parentPath,
1957 bool useDelegate =
true);
1959 void _PrimPopChild(
const SdfPath& parentPath,
1961 bool useDelegate =
true);
1969 void _PrimMoveSpec(
const SdfPath &oldPath,
const SdfPath &newPath,
1970 bool useDelegate =
true);
1978 bool _DeleteSpec(
const SdfPath &path);
1982 bool useDelegate =
true);
1985 void _PrimDeleteSpec(
const SdfPath &path,
bool inert,
1986 bool useDelegate =
true);
1990 void _PrimSetTimeSample(
const SdfPath& path,
double time,
1992 bool useDelegate =
true);
1996 template <
typename ChildPolicy>
2000 SdfLayerHandle _self;
2003 SdfFileFormatConstPtr _fileFormat;
2012 mutable Sdf_IdentityRegistry _idRegistry;
2015 SdfAbstractDataRefPtr _data;
2018 SdfLayerStateDelegateBaseRefPtr _stateDelegate;
2030 std::atomic<bool> _initializationComplete;
2034 std::optional<bool> _initializationWasSuccessful;
2037 mutable bool _lastDirtyState;
2040 std::unique_ptr<Sdf_AssetInfo> _assetInfo;
2043 mutable VtValue _assetModificationTime;
2050 mutable size_t _mutedLayersRevisionCache;
2054 mutable bool _isMutedCache;
2057 bool _permissionToEdit;
2058 bool _permissionToSave;
2061 bool _validateAuthoring;
2071 friend class Sdf_ChangeManager;
2074 template <
class ChildPolicy>
friend class Sdf_ChildrenUtils;
2086PXR_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.
A list of scene description modifications, organized by the namespace paths where the changes occur.
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 ...
SDF_API SdfRelocates GetRelocates() const
Get the list of relocates specified in this layer's metadata.
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 SetTimeSample(const SdfPath &path, double time, const VtValue &value)
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 void EraseTimeSample(const SdfPath &path, double time)
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 GetNumTimeSamplesForPath(const SdfPath &path) const
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.
void SetTimeSample(const SdfPath &path, double time, const T &value)
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 SdfPath GetDefaultPrimAsPath() const
Return this layer's default prim metadata interpreted as an absolute prim path regardless of whether ...
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 void SetTimeSample(const SdfPath &path, double time, const SdfAbstractDataConstValue &value)
SDF_API SdfPropertySpecHandle GetPropertyAtPath(const SdfPath &path)
Returns a property at the given path.
SDF_API void ClearRelocates()
Clears the layer relocates opinion in the layer's metadata.
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 void SetRelocates(const SdfRelocates &relocates)
Set the entire list of namespace relocations specified on this layer to relocates.
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.
SDF_API SdfChangeList CreateDiff(const SdfLayerHandle &layer, bool processPropertyFields=true) const
Returns a SdfChangeList containing the minimal edits that would be needed to transform this layer to ...
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.
SDF_API bool GetBracketingTimeSamplesForPath(const SdfPath &path, double time, double *tLower, double *tUpper)
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 std::set< double > ListTimeSamplesForPath(const SdfPath &path) const
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...
bool QueryTimeSample(const SdfPath &path, double time, T *data) const
SDF_API void SetStartTimeCode(double startTimecode)
Sets the layer's start timeCode.
SDF_API bool QueryTimeSample(const SdfPath &path, double time, SdfAbstractDataValue *value) const
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.
SDF_API bool QueryTimeSample(const SdfPath &path, double time, VtValue *value=NULL) const
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.
SDF_API bool HasRelocates() const
Returns true if this layer's metadata has any relocates opinion, including that there should be no re...
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.
std::vector< SdfRelocate > SdfRelocates
A vector of relocation source path to target path pairs.