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"
47 #include <boost/optional.hpp>
56 PXR_NAMESPACE_OPEN_SCOPE
146 const std::string &identifier,
160 const std::string &identifier,
171 static SdfLayerHandle
Find(
172 const std::string &identifier,
187 const SdfLayerHandle &anchor,
188 const std::string &identifier,
199 const std::string &identifier,
214 const SdfLayerHandle &anchor,
215 const std::string &identifier,
233 const std::string &layerPath,
234 bool metadataOnly =
false,
235 const std::string& tag = std::string());
276 const std::string& tag = std::string(),
282 const std::string &tag,
const SdfFileFormatConstPtr &format,
298 const std::string& identifier);
309 bool Save(
bool force =
false)
const;
324 bool Export(
const std::string& filename,
325 const std::string& comment = std::string(),
373 bool Reload(
bool force =
false);
382 static bool ReloadLayers(
const std::set<SdfLayerHandle>& layers,
391 bool Import(
const std::string &layerPath);
411 const std::string &oldAssetPath,
412 const std::string &newAssetPath=std::string());
449 const std::string& identifier,
450 std::string* layerPath,
456 const std::string& layerPath,
589 return HasField(path, name, static_cast<VtValue *>(NULL));
594 path, name, static_cast<SdfAbstractDataValue *>(&outValue));
596 if (std::is_same<T, SdfValueBlock>::value) {
597 return hasValue && outValue.isValueBlock;
600 return hasValue && (!outValue.isValueBlock);
607 return _data->GetTypeid(path, name);
630 const TfToken &keyPath, T* value)
const
634 static_cast<VtValue *>(NULL));
639 static_cast<SdfAbstractDataValue *>(&outValue));
647 const TfToken& fieldName)
const;
653 const TfToken& fieldName,
const T& defaultValue = T())
const
655 return _data->GetAs<T>(path, fieldName, defaultValue);
960 void SetOwner(
const std::string& owner);
986 void ClearSessionOwner();
1032 void SetRootPrims(
const SdfPrimSpecHandleVector &rootPrims);
1040 bool InsertRootPrim(
const SdfPrimSpecHandle &prim,
int index = -1);
1185 static bool IsMuted(
const std::string &path);
1342 std::set<double> ListAllTimeSamples()
const;
1346 ListTimeSamplesForPath(
const SdfPath& path)
const;
1349 bool GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper);
1352 size_t GetNumTimeSamplesForPath(
const SdfPath& path)
const;
1355 bool GetBracketingTimeSamplesForPath(
const SdfPath& path,
1357 double* tLower,
double* tUpper);
1360 bool QueryTimeSample(
const SdfPath& path,
double time,
1363 bool QueryTimeSample(
const SdfPath& path,
double time,
1367 bool QueryTimeSample(
const SdfPath& path,
double time,
1371 return QueryTimeSample(path, time);
1375 const bool hasValue = QueryTimeSample(
1376 path, time, static_cast<SdfAbstractDataValue *>(&outValue));
1378 if (std::is_same<T, SdfValueBlock>::value) {
1379 return hasValue && outValue.isValueBlock;
1382 return hasValue && (!outValue.isValueBlock);
1386 void SetTimeSample(
const SdfPath& path,
double time,
1389 void SetTimeSample(
const SdfPath& path,
double time,
1393 void SetTimeSample(
const SdfPath& path,
double time,
1398 return SetTimeSample(path, time, untypedInValue);
1402 void EraseTimeSample(
const SdfPath& path,
double time);
1410 static void DumpLayerInfo();
1414 bool WriteDataFile(
const std::string &filename);
1421 SdfLayer(
const SdfFileFormatConstPtr& fileFormat,
1422 const std::string &identifier,
1423 const std::string &realPath = std::string(),
1426 bool validateAuthoring =
false);
1432 SdfFileFormatConstPtr fileFormat,
1433 const std::string& identifier,
1437 const SdfFileFormatConstPtr &fileFormat,
1438 const std::string& identifier,
1439 const std::string& realPath,
1444 const SdfFileFormatConstPtr &fileFormat,
1445 const std::string& tag,
1451 void _FinishInitialization(
bool success);
1463 bool _WaitForInitializationAndCheckIfSuccessful();
1467 bool _ShouldNotify()
const;
1475 bool _UpdateLastDirtinessState()
const;
1485 bool _CanGetSpecAtPath(
const SdfPath& path,
1491 void _InitializeFromIdentifier(
1492 const std::string &identifier,
1493 const std::string &realPath = std::string(),
1494 const std::string &fileVersion = std::string(),
1499 struct _FindOrOpenLayerInfo;
1500 static bool _ComputeInfoToFindOrOpenLayer(
1501 const std::string& identifier,
1503 _FindOrOpenLayerInfo* info,
1504 bool computeAssetInfo =
false);
1509 template <
class Lock>
1512 const _FindOrOpenLayerInfo& info,
1520 template <
class ScopedLock>
1522 _Find(
const std::string &identifier,
1524 ScopedLock &lock,
bool retryAsWriter);
1534 template <
class ScopedLock>
1536 _TryToFindLayer(
const std::string &identifier,
1537 const std::string &resolvedPath,
1538 ScopedLock &lock,
bool retryAsWriter);
1547 bool _IsInert(
const SdfPath &path,
bool ignoreChildren,
1548 bool requiredFieldOnlyPropertiesAreInert =
false)
const;
1558 bool _IsInertSubtree(
const SdfPath &path,
1559 std::vector<SdfPath>* inertSpecs =
nullptr);
1566 void _RemoveIfInert(
const SdfSpec& spec);
1572 bool _RemoveInertDFS(SdfPrimSpecHandle prim);
1576 void _RemoveInertToRootmost(SdfPrimSpecHandle prim);
1579 bool _ValidateAuthoring()
const {
return _validateAuthoring; }
1582 std::string _GetMutedPath()
const;
1586 void _UpdateReferencePaths(
const SdfPrimSpecHandle &parent,
1587 const std::string &oldLayerPath,
1588 const std::string &newLayerPath);
1591 void _MarkCurrentStateAsClean()
const;
1596 _GetRequiredFieldDef(
const SdfPath &path,
1608 static std::vector<TfToken>
1629 void _SetValue(
const TfToken& key, T value);
1633 T _GetValue(
const TfToken& key)
const;
1635 enum _ReloadResult { _ReloadFailed, _ReloadSucceeded, _ReloadSkipped };
1636 _ReloadResult _Reload(
bool force);
1640 bool _Read(
const std::string& identifier,
1641 const std::string& resolvedPath,
1647 bool _Save(
bool force)
const;
1655 bool _WriteToFile(
const std::string& newFileName,
1656 const std::string& comment,
1657 SdfFileFormatConstPtr fileFormat = TfNullPtr,
1663 void _SwapData(SdfAbstractDataRefPtr &data);
1672 void _SetData(
const SdfAbstractDataPtr &newData,
1676 SdfAbstractDataConstPtr _GetData()
const;
1680 void _PrimSetField(
const SdfPath& path,
1683 const VtValue *oldValue = NULL,
1684 bool useDelegate =
true);
1688 void _PrimSetFieldDictValueByKey(
const SdfPath& path,
1692 const VtValue *oldValue = NULL,
1693 bool useDelegate =
true);
1697 void _PrimPushChild(
const SdfPath& parentPath,
1700 bool useDelegate =
true);
1702 void _PrimPopChild(
const SdfPath& parentPath,
1704 bool useDelegate =
true);
1712 void _PrimMoveSpec(
const SdfPath &oldPath,
const SdfPath &newPath,
1713 bool useDelegate =
true);
1721 bool _DeleteSpec(
const SdfPath &path);
1725 bool useDelegate =
true);
1728 void _PrimDeleteSpec(
const SdfPath &path,
bool inert,
1729 bool useDelegate =
true);
1733 void _PrimSetTimeSample(
const SdfPath& path,
double time,
1735 bool useDelegate =
true);
1739 template <
typename ChildPolicy>
1743 SdfLayerHandle _self;
1746 SdfFileFormatConstPtr _fileFormat;
1750 mutable Sdf_IdentityRegistry _idRegistry;
1753 SdfAbstractDataRefPtr _data;
1756 SdfLayerStateDelegateBaseRefPtr _stateDelegate;
1764 std::atomic<bool> _initializationComplete;
1769 boost::optional<bool> _initializationWasSuccessful;
1772 mutable bool _lastDirtyState;
1775 std::unique_ptr<Sdf_AssetInfo> _assetInfo;
1778 mutable VtValue _assetModificationTime;
1785 mutable size_t _mutedLayersRevisionCache;
1789 mutable bool _isMutedCache;
1792 bool _permissionToEdit;
1793 bool _permissionToSave;
1796 bool _validateAuthoring;
1806 friend class Sdf_ChangeManager;
1809 template <
class ChildPolicy>
friend class Sdf_ChildrenUtils;
1821 PXR_NAMESPACE_CLOSE_SCOPE
1823 #endif // PXR_USD_SDF_LAYER_H
SDF_API void SetSessionOwner(const std::string &owner)
Sets the layer's session owner.
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 void SetStateDelegate(const SdfLayerStateDelegateBaseRefPtr &delegate)
Sets the state delegate used to manage this layer's authoring state.
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.
std::vector< SdfNamespaceEditDetail > SdfNamespaceEditDetailVector
A sequence of SdfNamespaceEditDetail.
A unit of scene description that you combine with other units of scene description to form a shot...
SDF_API const VtValue & GetAssetInfo() const
Returns resolve information from the last time the layer identifier was resolved. ...
SDF_API std::vector< TfToken > ListFields(const SdfPath &path) const
Return the names of all the fields that are set at path.
SDF_API void SetCustomLayerData(const VtDictionary &value)
Sets the CustomLayerData dictionary associated with this layer.
SDF_API bool HasSessionOwner() const
Returns true if the layer has a session owner opinion.
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 SdfPrimSpecHandle GetPseudoRoot() const
Returns the layer's pseudo-root prim.
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 bool PermissionToSave() const
Returns true if the caller is allowed to save the layer to its existing fileName and false otherwise...
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 SetHasOwnedSubLayers(bool)
Sets whether the layer's sublayers are expected to have owners.
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 void SetEndTimeCode(double endTimeCode)
Sets the layer's end timeCode.
SDF_API double GetFramesPerSecond() const
Returns the layer's frames per second.
SDF_API const SdfSchemaBase & GetSchema() const
Returns the schema this layer adheres to.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
SDF_API SdfSpecType GetSpecType(const SdfPath &path) const
Return the spec type for path.
Standard pointer typedefs.
Base class for SdfAttributeSpec and SdfRelationshipSpec.
SDF_API SdfSpecHandle GetObjectAtPath(const SdfPath &path)
Returns the object at the given path.
SDF_API bool Apply(const SdfBatchNamespaceEdit &)
Performs a batch of namespace edits.
SDF_API void SetOwner(const std::string &owner)
Sets the layer's owner.
SDF_API void UpdateAssetInfo()
Update layer asset information.
SDF_API void RemoveRootPrim(const SdfPrimSpecHandle &prim)
Remove a root prim.
A type-erased container for a const field value in an SdfAbstractData.
The fully-typed container for a field value in an SdfAbstractData.
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 bool HasColorConfiguration() const
Returns true if color configuration metadata is set in this layer.
SDF_API SdfSubLayerProxy GetSubLayerPaths() const
Returns a proxy for this layer's sublayers.
A type-erased container for a field value in an SdfAbstractData.
A map with string keys and VtValue values.
std::function< void(const SdfPath &)> TraversalFunction
Callback function for Traverse.
SDF_API void SetFramePrecision(int framePrecision)
Sets the layer's frame precision.
SDF_API bool InsertRootPrim(const SdfPrimSpecHandle &prim, int index=-1)
Adds a new root prim at the given index.
SDF_API SdfPropertySpecHandle GetPropertyAtPath(const SdfPath &path)
Returns a property at the given path.
Generic class that provides information about scene description fields but doesn't actually provide a...
Base class for all Sdf spec classes.
SDF_API void ClearCustomLayerData()
Clears out the CustomLayerData dictionary associated with this layer.
static SDF_API std::set< std::string > GetMutedLayers()
Returns the set of muted layer paths.
SDF_API void RemovePrimIfInert(SdfPrimSpecHandle prim)
Removes scene description that does not affect the scene in the layer namespace beginning with prim...
SDF_API void RemovePropertyIfHasOnlyRequiredFields(SdfPropertySpecHandle prop)
Removes prop if it has only required fields (i.e.
SDF_API bool HasCustomLayerData() const
Returns true if CustomLayerData is authored on the layer.
SDF_API bool IsDirty() const
Returns true if the layer is dirty, i.e.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
SDF_API bool ImportFromString(const std::string &string)
Reads this layer from the given string.
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 InsertSubLayerPath(const std::string &path, int index=-1)
Inserts new sublayer path at the given index.
SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check...
SDF_API void SetFramesPerSecond(double framesPerSecond)
Sets the layer's frames per second.
SDF_API bool HasFramePrecision() const
Returns true if the layer has a frames precision opinion.
SDF_API const std::string & GetIdentifier() const
Returns the layer identifier.
SDF_API void ClearFramesPerSecond()
Clear the framesPerSecond opinion.
SDF_API void RemoveInertSceneDescription()
Removes all scene description in this layer that does not affect the scene.
SDF_API SdfAssetPath GetColorConfiguration() const
Returns the color configuration asset-path for this layer.
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 TfToken GetColorManagementSystem() const
Returns the color management system used to interpret the color configuration asset-path authored in ...
SDF_API bool IsMuted() const
Returns true if the current layer is muted.
SDF_API void SetRootPrims(const SdfPrimSpecHandleVector &rootPrims)
Sets a new vector of root prims.
Enable a concrete base class for use with TfRefPtr.
SDF_API std::set< std::string > GetExternalReferences() const
Return paths of all external references of layer.
SDF_API bool HasSpec(const SdfPath &path) const
Return whether a spec exists at path.
static SDF_API bool ReloadLayers(const std::set< SdfLayerHandle > &layers, bool force=false)
Reloads the specified layers.
SDF_API void SetMuted(bool muted)
Mutes the current layer if muted is true, and unmutes it otherwise.
SDF_API bool HasDefaultPrim()
Return true if the default prim metadata is set in this layer.
Token for efficient comparison, assignment, and hashing of known strings.
SDF_API bool Reload(bool force=false)
Reloads the layer from its persistent representation.
A subclass of SdfPropertySpec that holds typed data.
Class defining various attributes for a field.
SDF_API void RemoveSubLayerPath(int index)
Removes sublayer path at the given index.
SDF_API void SetColorConfiguration(const SdfAssetPath &colorConfiguration)
Sets the color configuration asset-path for this layer.
SDF_API std::string GetSessionOwner() const
Returns the layer's session owner.
SDF_API void SetStartTimeCode(double startTimecode)
Sets the layer's start timeCode.
SDF_API void ClearEndTimeCode()
Clear the endTimeCode opinion.
SDF_API void SetIdentifier(const std::string &identifier)
Sets the layer identifier.
A description of an arbitrarily complex namespace edit.
SDF_API bool GetHasOwnedSubLayers() const
Returns true if the layer's sublayers are expected to have owners.
Represents a single list of list editing operations.
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 SdfLayerRefPtr CreateNew(const std::string &identifier, const FileFormatArguments &args=FileFormatArguments())
Creates a new empty layer with the given identifier.
SDF_API void TransferContent(const SdfLayerHandle &layer)
Copies the content of the given layer into this layer.
SDF_API TfToken GetDefaultPrim() const
Return the defaultPrim metadata for this layer.
static SDF_API void AddToMutedLayers(const std::string &mutedPath)
Add the specified path to the muted layers set.
SDF_API double GetTimeCodesPerSecond() const
Returns the layer's timeCodes per second.
SDF_API double GetEndTimeCode() const
Returns the layer's end timeCode.
The fully-typed container for a field value in an SdfAbstractData.
SDF_API const ArResolvedPath & GetResolvedPath() const
Returns the resolved path for this layer.
virtual SDF_API ~SdfLayer()
Destructor.
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...
Result
Validity of an edit.
SDF_API bool UpdateExternalReference(const std::string &oldAssetPath, const std::string &newAssetPath=std::string())
Updates the external references of the layer.
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.
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
SDF_API std::string GetOwner() const
Returns the layer's owner.
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 VtValue GetField(const SdfPath &path, const TfToken &fieldName) const
Return the value for the given path and fieldName.
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 SdfLayerOffset GetSubLayerOffset(int index) const
Returns the layer offset for the subLayer path at the given index.
SDF_API void SetPermissionToEdit(bool allow)
Sets permission to edit.
SDF_API SdfRelationshipSpecHandle GetRelationshipAtPath(const SdfPath &path)
Returns a relationship at the given path.
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 SdfPrimSpecHandle GetPrimAtPath(const SdfPath &path)
Returns the prim at the given path.
A path value used to locate objects in layers or scenegraphs.
SDF_API void ClearColorConfiguration()
Clears the color configuration metadata authored in this layer.
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 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 bool ExportToString(std::string *result) const
Writes this layer to the given string.
SDF_API SdfLayerStateDelegateBasePtr GetStateDelegate() const
Returns the state delegate used to manage this layer's authoring state.
SDF_API void InsertInRootPrimOrder(const TfToken &name, int index=-1)
Adds a new root prim name in the root prim order.
SDF_API void ClearOwner()
Clear the owner opinion.
void SetField(const SdfPath &path, const TfToken &fieldName, const T &val)
Set the value of the given path and fieldName.
SDF_API void SetSubLayerPaths(const std::vector< std::string > &newPaths)
Sets the paths of the layer's sublayers.
SDF_API void SetSubLayerOffset(const SdfLayerOffset &offset, int index)
Sets the layer offset for the subLayer path at the given index.
static SDF_API SdfLayerHandleSet GetLoadedLayers()
Returns handles for all layers currently held by the layer registry.
SDF_API std::string GetFileExtension() const
Returns the file extension to use for this layer.
Represents a resolved asset path.
SDF_API bool IsAnonymous() const
Returns true if this layer is an anonymous layer.
SDF_API double GetStartTimeCode() const
Returns the layer's start timeCode.
SDF_API void Clear()
Clears the layer of all content.
SDF_API VtDictionary GetCustomLayerData() const
Returns the CustomLayerData dictionary associated with this layer.
Contains an asset path and an optional resolved path.
SDF_API bool HasStartTimeCode() const
Returns true if the layer has a startTimeCode opinion.
static SDF_API std::string GetDisplayNameFromIdentifier(const std::string &identifier)
Returns the display name for the given identifier, using the same rules as GetDisplayName.
SdfSpecType
An enum that specifies the type of an object.
SDF_API const FileFormatArguments & GetFileFormatArguments() const
Returns the file format-specific arguments used during the construction of this layer.
SDF_API void SetField(const SdfPath &path, const TfToken &fieldName, const VtValue &value)
Set the value of the given path and fieldName.
SDF_API void ClearTimeCodesPerSecond()
Clear the timeCodesPerSecond opinion.
SDF_API std::string GetComment() const
Returns the comment string for this layer.
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 const std::string & GetRepositoryPath() const
Returns the layer identifier in asset path form.
SDF_API void SetDefaultPrim(const TfToken &name)
Set the default prim metadata for this layer.
SDF_API void ClearColorManagementSystem()
Clears the 'colorManagementSystem' metadata authored in this layer.
SDF_API void ClearFramePrecision()
Clear the framePrecision opinion.
SDF_API const std::string & GetVersion() const
Returns the asset system version of this layer.
SDF_API bool HasOwner() const
Returns true if the layer has an owner opinion.
SDF_API void ClearDefaultPrim()
Clear the default prim metadata for this layer.
SdfLayer(const SdfLayer &)=delete
Noncopyable.
SDF_API SdfLayerOffsetVector GetSubLayerOffsets() const
Returns the layer offsets for all the subLayer paths.
SDF_API int GetFramePrecision() const
Returns the layer's frame precision.
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.
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...
T GetFieldAs(const SdfPath &path, const TfToken &fieldName, const T &defaultValue=T()) const
Return the value for the given path and fieldName.
Contains hints about layer contents that may be used to accelerate certain composition operations...
SDF_API bool HasFramesPerSecond() const
Returns true if the layer has a frames per second opinion.
Provides a view onto an object's children.
SDF_API SdfAttributeSpecHandle GetAttributeAtPath(const SdfPath &path)
Returns an attribute at the given path.
SDF_API SdfNamespaceEditDetail::Result CanApply(const SdfBatchNamespaceEdit &, SdfNamespaceEditDetailVector *details=NULL) const
Check if a batch of namespace edits will succeed.
Maintains authoring state information for an associated layer.
SDF_API void SetDocumentation(const std::string &documentation)
Sets the documentation string for this layer.
SDF_API std::string GetDisplayName() const
Returns the layer's display name.
static SDF_API bool IsAnonymousLayerIdentifier(const std::string &identifier)
Returns true if the identifier is an anonymous layer unique identifier.
SDF_API bool HasEndTimeCode() const
Returns true if the layer has an endTimeCode opinion.
SDF_API const SdfFileFormatConstPtr & GetFileFormat() const
Returns the file format used by this layer.
SDF_API void RemoveFromRootPrimOrder(const TfToken &name)
Removes a root prim name from the root prim order.
SDF_API void EraseField(const SdfPath &path, const TfToken &fieldName)
Remove the field at path and fieldName, if one exists.
Represents a time offset and scale between layers.
SDF_API void SetComment(const std::string &comment)
Sets the comment string for this layer.
SDF_API void RemoveFromRootPrimOrderByIndex(int index)
Removes a root prim name from the root prim order by index.
SDF_API bool HasTimeCodesPerSecond() const
Returns true if the layer has a timeCodesPerSecond opinion.
SDF_API size_t GetNumSubLayerPaths() const
Returns the number of sublayer paths (and offsets).
SDF_API bool Import(const std::string &layerPath)
Imports the content of the given layer path, replacing the content of the current layer...
SDF_API bool PermissionToEdit() const
Returns true if the caller is allowed to modify the layer and false otherwise.
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.
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 RootPrimsView GetRootPrims() const
Returns a vector of the layer's root prims.
SDF_API SdfLayerHints GetHints() const
Return hints about the layer's current contents.
Enable a concrete base class for use with TfWeakPtr.
SDF_API std::string GetDocumentation() const
Returns the documentation string for this layer.
static SDF_API void RemoveFromMutedLayers(const std::string &mutedPath)
Remove the specified path from the muted layers set.
SDF_API SdfNameOrderProxy GetRootPrimOrder() const
Returns the list of prim names for this layer's reorder rootPrims statement.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
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 void SetPermissionToSave(bool allow)
Sets permission to save.
SDF_API const std::string & GetAssetName() const
Returns the asset name associated with this layer.
SDF_API bool IsEmpty() const
Returns whether this layer has no significant data.
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 bool Save(bool force=false) const
Returns true if successful, false if an error occurred.
SDF_API const std::string & GetRealPath() const
Returns the resolved path for this layer.
SDF_API void ClearStartTimeCode()
Clear the startTimeCode opinion.
SDF_API void SetTimeCodesPerSecond(double timeCodesPerSecond)
Sets the layer's timeCodes per second.
SDF_API SdfDataRefPtr GetMetadata() const
Returns the data from the absolute root path of this layer.
Interface for scene description data storage.
Contains information about a resolved asset.
static SDF_API SdfLayerRefPtr CreateAnonymous(const std::string &tag=std::string(), const FileFormatArguments &args=FileFormatArguments())
Creates a new anonymous layer with an optional tag.