30 #include "pxr/usd/sdf/api.h"
31 #include "pxr/usd/sdf/data.h"
32 #include "pxr/usd/sdf/declareHandles.h"
33 #include "pxr/usd/sdf/identity.h"
34 #include "pxr/usd/sdf/layerOffset.h"
35 #include "pxr/usd/sdf/namespaceEdit.h"
36 #include "pxr/usd/sdf/path.h"
37 #include "pxr/usd/sdf/proxyTypes.h"
38 #include "pxr/usd/sdf/spec.h"
39 #include "pxr/usd/sdf/types.h"
40 #include "pxr/usd/ar/assetInfo.h"
41 #include "pxr/base/tf/declarePtrs.h"
42 #include "pxr/base/vt/value.h"
44 #include <boost/optional.hpp>
53 PXR_NAMESPACE_OPEN_SCOPE
138 const std::string &realPath = std::string(),
150 const std::string &identifier,
151 const std::string &realPath = std::string(),
170 const std::string &identifier,
171 const std::string &realPath = std::string(),
178 static SdfLayerHandle
Find(
179 const std::string &identifier,
188 const SdfLayerHandle &anchor,
189 const std::string &layerPath,
200 const std::string &identifier,
218 const std::string &layerPath,
219 bool metadataOnly =
false,
220 const std::string& tag = std::string());
255 const std::string& tag = std::string(),
261 const std::string &tag,
const SdfFileFormatConstPtr &format,
277 const std::string& identifier);
292 bool Save(
bool force =
false)
const;
307 bool Export(
const std::string& filename,
308 const std::string& comment = std::string(),
352 bool Reload(
bool force =
false);
361 static bool ReloadLayers(
const std::set<SdfLayerHandle>& layers,
370 bool Import(
const std::string &layerPath);
390 const std::string &oldAssetPath,
391 const std::string &newAssetPath=std::string());
417 const std::string& identifier,
418 std::string* layerPath,
424 const std::string& layerPath,
538 return HasField(path, name, static_cast<VtValue *>(NULL));
543 path, name, static_cast<SdfAbstractDataValue *>(&outValue));
545 if (std::is_same<T, SdfValueBlock>::value) {
546 return hasValue && outValue.isValueBlock;
549 return hasValue && (!outValue.isValueBlock);
556 return _data->GetTypeid(path, name);
579 const TfToken &keyPath, T* value)
const
583 static_cast<VtValue *>(NULL));
588 static_cast<SdfAbstractDataValue *>(&outValue));
596 const TfToken& fieldName)
const;
602 const TfToken& fieldName,
const T& defaultValue = T())
const
604 return _data->GetAs<T>(path, fieldName, defaultValue);
901 void SetOwner(
const std::string& owner);
927 void ClearSessionOwner();
973 void SetRootPrims(
const SdfPrimSpecHandleVector &rootPrims);
981 bool InsertRootPrim(
const SdfPrimSpecHandle &prim,
int index = -1);
1122 static bool IsMuted(
const std::string &path);
1279 std::set<double> ListAllTimeSamples()
const;
1283 ListTimeSamplesForPath(
const SdfPath& path)
const;
1286 bool GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper);
1289 size_t GetNumTimeSamplesForPath(
const SdfPath& path)
const;
1292 bool GetBracketingTimeSamplesForPath(
const SdfPath& path,
1294 double* tLower,
double* tUpper);
1297 bool QueryTimeSample(
const SdfPath& path,
double time,
1300 bool QueryTimeSample(
const SdfPath& path,
double time,
1304 bool QueryTimeSample(
const SdfPath& path,
double time,
1308 return QueryTimeSample(path, time);
1312 const bool hasValue = QueryTimeSample(
1313 path, time, static_cast<SdfAbstractDataValue *>(&outValue));
1315 if (std::is_same<T, SdfValueBlock>::value) {
1316 return hasValue && outValue.isValueBlock;
1319 return hasValue && (!outValue.isValueBlock);
1323 void SetTimeSample(
const SdfPath& path,
double time,
1326 void SetTimeSample(
const SdfPath& path,
double time,
1330 void SetTimeSample(
const SdfPath& path,
double time,
1335 return SetTimeSample(path, time, untypedInValue);
1339 void EraseTimeSample(
const SdfPath& path,
double time);
1347 static void DumpLayerInfo();
1351 bool WriteDataFile(
const std::string &filename);
1358 SdfLayer(
const SdfFileFormatConstPtr& fileFormat,
1359 const std::string &identifier,
1360 const std::string &realPath = std::string(),
1363 bool validateAuthoring =
false);
1369 SdfFileFormatConstPtr fileFormat,
1370 const std::string& identifier,
1371 const std::string& realPath,
1376 const SdfFileFormatConstPtr &fileFormat,
1377 const std::string& identifier,
1378 const std::string& realPath,
1383 const SdfFileFormatConstPtr &fileFormat,
1384 const std::string& tag,
1390 void _FinishInitialization(
bool success);
1402 bool _WaitForInitializationAndCheckIfSuccessful();
1406 bool _ShouldNotify()
const;
1414 bool _UpdateLastDirtinessState()
const;
1424 bool _CanGetSpecAtPath(
const SdfPath& path,
1430 void _InitializeFromIdentifier(
1431 const std::string &identifier,
1432 const std::string &realPath = std::string(),
1433 const std::string &fileVersion = std::string(),
1438 struct _FindOrOpenLayerInfo;
1439 static bool _ComputeInfoToFindOrOpenLayer(
1440 const std::string& identifier,
1442 _FindOrOpenLayerInfo* info,
1443 bool computeAssetInfo =
false);
1448 template <
class Lock>
1451 const _FindOrOpenLayerInfo& info,
1462 template <
class ScopedLock>
1464 _TryToFindLayer(
const std::string &identifier,
1465 const std::string &resolvedPath,
1466 ScopedLock &lock,
bool retryAsWriter);
1475 bool _IsInert(
const SdfPath &path,
bool ignoreChildren,
1476 bool requiredFieldOnlyPropertiesAreInert =
false)
const;
1486 bool _IsInertSubtree(
const SdfPath &path,
1487 std::vector<SdfPath>* inertSpecs =
nullptr);
1494 void _RemoveIfInert(
const SdfSpec& spec);
1500 bool _RemoveInertDFS(SdfPrimSpecHandle prim);
1504 void _RemoveInertToRootmost(SdfPrimSpecHandle prim);
1507 bool _ValidateAuthoring()
const {
return _validateAuthoring; }
1510 std::string _GetMutedPath()
const;
1514 void _UpdateReferencePaths(
const SdfPrimSpecHandle &parent,
1515 const std::string &oldLayerPath,
1516 const std::string &newLayerPath);
1519 void _MarkCurrentStateAsClean()
const;
1524 _GetRequiredFieldDef(
const SdfPath &path,
1530 void _SetValue(
const TfToken& key, T value);
1534 T _GetValue(
const TfToken& key)
const;
1536 enum _ReloadResult { _ReloadFailed, _ReloadSucceeded, _ReloadSkipped };
1537 _ReloadResult _Reload(
bool force);
1541 bool _Read(
const std::string& identifier,
1542 const std::string& resolvedPath,
1548 bool _Save(
bool force)
const;
1556 bool _WriteToFile(
const std::string& newFileName,
1557 const std::string& comment,
1558 SdfFileFormatConstPtr fileFormat = TfNullPtr,
1564 void _SwapData(SdfAbstractDataRefPtr &data);
1568 void _SetData(
const SdfAbstractDataPtr &data);
1571 SdfAbstractDataConstPtr _GetData()
const;
1575 void _PrimSetField(
const SdfPath& path,
1578 const VtValue *oldValue = NULL,
1579 bool useDelegate =
true);
1583 void _PrimSetFieldDictValueByKey(
const SdfPath& path,
1587 const VtValue *oldValue = NULL,
1588 bool useDelegate =
true);
1592 void _PrimPushChild(
const SdfPath& parentPath,
1595 bool useDelegate =
true);
1597 void _PrimPopChild(
const SdfPath& parentPath,
1599 bool useDelegate =
true);
1607 void _PrimMoveSpec(
const SdfPath &oldPath,
const SdfPath &newPath,
1608 bool useDelegate =
true);
1616 bool _DeleteSpec(
const SdfPath &path);
1620 bool useDelegate =
true);
1623 void _PrimDeleteSpec(
const SdfPath &path,
bool inert,
1624 bool useDelegate =
true);
1628 void _PrimSetTimeSample(
const SdfPath& path,
double time,
1630 bool useDelegate =
true);
1634 template <
typename ChildPolicy>
1639 SdfFileFormatConstPtr _fileFormat;
1643 mutable Sdf_IdentityRegistry _idRegistry;
1646 SdfAbstractDataRefPtr _data;
1649 SdfLayerStateDelegateBaseRefPtr _stateDelegate;
1657 std::mutex _initializationMutex;
1662 boost::optional<bool> _initializationWasSuccessful;
1665 mutable bool _lastDirtyState;
1668 std::unique_ptr<Sdf_AssetInfo> _assetInfo;
1671 mutable VtValue _assetModificationTime;
1674 mutable size_t _mutedLayersRevisionCache;
1678 mutable bool _isMutedCache;
1681 bool _permissionToEdit;
1682 bool _permissionToSave;
1685 bool _validateAuthoring;
1692 friend class Sdf_ChangeManager;
1695 template <
class ChildPolicy>
friend class Sdf_ChildrenUtils;
1707 PXR_NAMESPACE_CLOSE_SCOPE
1709 #endif // 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 from disk...
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 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 specifiers for path.
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 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.
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.
SdfSpecType
An enum that specifies the type of an object.
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())
Returns the layer for the given path if found in the layer registry.
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.
static SDF_API SdfLayerHandle FindRelativeToLayer(const SdfLayerHandle &anchor, const std::string &layerPath, const FileFormatArguments &args=FileFormatArguments())
Returns the layer for layerPath, assumed to be relative to the path of the anchor 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...
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 std::set< std::string > GetExternalReferences()
Return paths of all external references of 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.
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 SdfPrimSpecHandle GetPrimAtPath(const SdfPath &path)
Returns the prim at the given path.
A path value used to locate objects in layers or scenegraphs.
static SDF_API SdfLayerRefPtr New(const SdfFileFormatConstPtr &fileFormat, const std::string &identifier, const std::string &realPath=std::string(), const FileFormatArguments &args=FileFormatArguments())
Creates a new empty layer with the given identifier for a given file format class.
SDF_API void ClearColorConfiguration()
Clears the color configuration metadata authored in this layer.
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.
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 UpdateAssetInfo(const std::string &fileVersion=std::string())
Update layer asset information.
SDF_API void Clear()
Clears the layer of all content.
SDF_API VtDictionary GetCustomLayerData() const
Returns the CustomLayerData dictionary associated with this layer.
static SDF_API SdfLayerRefPtr CreateNew(const std::string &identifier, const std::string &realPath=std::string(), const FileFormatArguments &args=FileFormatArguments())
Creates a new empty layer with the given identifier.
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.
static SDF_API std::string ComputeRealPath(const std::string &layerPath)
Converts layerPath to a file system path.
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.
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 std::string ComputeAbsolutePath(const std::string &relativePath)
Make the given relativePath absolute using the identifier of this layer.
SDF_API RootPrimsView GetRootPrims() const
Returns a vector of the layer's root prims.
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 file system path where this layer exists or may exist after a call to Save...
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.
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.