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> 57 PXR_NAMESPACE_OPEN_SCOPE
144 const std::string &identifier,
158 const std::string &identifier,
169 static SdfLayerHandle
Find(
170 const std::string &identifier,
185 const SdfLayerHandle &anchor,
186 const std::string &identifier,
197 const std::string &identifier,
212 const SdfLayerHandle &anchor,
213 const std::string &identifier,
231 const std::string &layerPath,
232 bool metadataOnly =
false,
233 const std::string& tag = std::string());
274 const std::string& tag = std::string(),
280 const std::string &tag,
const SdfFileFormatConstPtr &format,
296 const std::string& identifier);
307 bool Save(
bool force =
false)
const;
322 bool Export(
const std::string& filename,
323 const std::string& comment = std::string(),
371 bool Reload(
bool force =
false);
380 static bool ReloadLayers(
const std::set<SdfLayerHandle>& layers,
389 bool Import(
const std::string &layerPath);
404 const std::string &oldAssetPath,
405 const std::string &newAssetPath=std::string());
428 const std::string &oldAssetPath,
429 const std::string &newAssetPath=std::string());
466 const std::string& identifier,
467 std::string* layerPath,
473 const std::string& layerPath,
601 return HasField(path, name, static_cast<VtValue *>(NULL));
606 path, name, static_cast<SdfAbstractDataValue *>(&outValue));
608 if (std::is_same<T, SdfValueBlock>::value) {
609 return hasValue && outValue.isValueBlock;
612 return hasValue && (!outValue.isValueBlock);
619 return _data->GetTypeid(path, name);
642 const TfToken &keyPath, T* value)
const 646 static_cast<VtValue *>(NULL));
651 static_cast<SdfAbstractDataValue *>(&outValue));
659 const TfToken& fieldName)
const;
665 const TfToken& fieldName,
const T& defaultValue = T())
const 667 return _data->GetAs<T>(path, fieldName, defaultValue);
972 void SetOwner(
const std::string& owner);
998 void ClearSessionOwner();
1044 void SetRootPrims(
const SdfPrimSpecHandleVector &rootPrims);
1052 bool InsertRootPrim(
const SdfPrimSpecHandle &prim,
int index = -1);
1197 static bool IsMuted(
const std::string &path);
1354 std::set<double> ListAllTimeSamples()
const;
1358 ListTimeSamplesForPath(
const SdfPath& path)
const;
1361 bool GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper);
1364 size_t GetNumTimeSamplesForPath(
const SdfPath& path)
const;
1367 bool GetBracketingTimeSamplesForPath(
const SdfPath& path,
1369 double* tLower,
double* tUpper);
1372 bool QueryTimeSample(
const SdfPath& path,
double time,
1375 bool QueryTimeSample(
const SdfPath& path,
double time,
1379 bool QueryTimeSample(
const SdfPath& path,
double time,
1383 return QueryTimeSample(path, time);
1387 const bool hasValue = QueryTimeSample(
1388 path, time, static_cast<SdfAbstractDataValue *>(&outValue));
1390 if (std::is_same<T, SdfValueBlock>::value) {
1391 return hasValue && outValue.isValueBlock;
1394 return hasValue && (!outValue.isValueBlock);
1398 void SetTimeSample(
const SdfPath& path,
double time,
1401 void SetTimeSample(
const SdfPath& path,
double time,
1405 void SetTimeSample(
const SdfPath& path,
double time,
1410 return SetTimeSample(path, time, untypedInValue);
1414 void EraseTimeSample(
const SdfPath& path,
double time);
1422 static void DumpLayerInfo();
1426 bool WriteDataFile(
const std::string &filename);
1433 SdfLayer(
const SdfFileFormatConstPtr& fileFormat,
1434 const std::string &identifier,
1435 const std::string &realPath = std::string(),
1438 bool validateAuthoring =
false);
1444 SdfFileFormatConstPtr fileFormat,
1445 const std::string& identifier,
1449 const SdfFileFormatConstPtr &fileFormat,
1450 const std::string& identifier,
1451 const std::string& realPath,
1456 const SdfFileFormatConstPtr &fileFormat,
1457 const std::string& tag,
1463 void _FinishInitialization(
bool success);
1475 bool _WaitForInitializationAndCheckIfSuccessful();
1479 bool _ShouldNotify()
const;
1487 bool _UpdateLastDirtinessState()
const;
1497 bool _CanGetSpecAtPath(
const SdfPath& path,
1503 void _InitializeFromIdentifier(
1504 const std::string &identifier,
1505 const std::string &realPath = std::string(),
1506 const std::string &fileVersion = std::string(),
1511 struct _FindOrOpenLayerInfo;
1512 static bool _ComputeInfoToFindOrOpenLayer(
1513 const std::string& identifier,
1515 _FindOrOpenLayerInfo* info,
1516 bool computeAssetInfo =
false);
1521 template <
class Lock>
1524 const _FindOrOpenLayerInfo& info,
1532 template <
class ScopedLock>
1534 _Find(
const std::string &identifier,
1536 ScopedLock &lock,
bool retryAsWriter);
1546 template <
class ScopedLock>
1548 _TryToFindLayer(
const std::string &identifier,
1549 const std::string &resolvedPath,
1550 ScopedLock &lock,
bool retryAsWriter);
1559 bool _IsInert(
const SdfPath &path,
bool ignoreChildren,
1560 bool requiredFieldOnlyPropertiesAreInert =
false)
const;
1570 bool _IsInertSubtree(
const SdfPath &path,
1571 std::vector<SdfPath>* inertSpecs =
nullptr);
1578 void _RemoveIfInert(
const SdfSpec& spec);
1584 bool _RemoveInertDFS(SdfPrimSpecHandle prim);
1588 void _RemoveInertToRootmost(SdfPrimSpecHandle prim);
1591 bool _ValidateAuthoring()
const {
return _validateAuthoring; }
1594 std::string _GetMutedPath()
const;
1598 void _UpdatePrimCompositionDependencyPaths(
1599 const SdfPrimSpecHandle &parent,
1600 const std::string &oldLayerPath,
1601 const std::string &newLayerPath);
1604 void _MarkCurrentStateAsClean()
const;
1609 _GetRequiredFieldDef(
const SdfPath &path,
1621 static std::vector<TfToken>
1642 void _SetValue(
const TfToken& key, T value);
1646 T _GetValue(
const TfToken& key)
const;
1648 enum _ReloadResult { _ReloadFailed, _ReloadSucceeded, _ReloadSkipped };
1649 _ReloadResult _Reload(
bool force);
1653 bool _Read(
const std::string& identifier,
1654 const std::string& resolvedPath,
1660 bool _Save(
bool force)
const;
1668 bool _WriteToFile(
const std::string& newFileName,
1669 const std::string& comment,
1670 SdfFileFormatConstPtr fileFormat = TfNullPtr,
1676 void _SwapData(SdfAbstractDataRefPtr &data);
1685 void _SetData(
const SdfAbstractDataPtr &newData,
1689 SdfAbstractDataConstPtr _GetData()
const;
1693 void _PrimSetField(
const SdfPath& path,
1696 const VtValue *oldValue = NULL,
1697 bool useDelegate =
true);
1701 void _PrimSetFieldDictValueByKey(
const SdfPath& path,
1705 const VtValue *oldValue = NULL,
1706 bool useDelegate =
true);
1710 void _PrimPushChild(
const SdfPath& parentPath,
1713 bool useDelegate =
true);
1715 void _PrimPopChild(
const SdfPath& parentPath,
1717 bool useDelegate =
true);
1725 void _PrimMoveSpec(
const SdfPath &oldPath,
const SdfPath &newPath,
1726 bool useDelegate =
true);
1734 bool _DeleteSpec(
const SdfPath &path);
1738 bool useDelegate =
true);
1741 void _PrimDeleteSpec(
const SdfPath &path,
bool inert,
1742 bool useDelegate =
true);
1746 void _PrimSetTimeSample(
const SdfPath& path,
double time,
1748 bool useDelegate =
true);
1752 template <
typename ChildPolicy>
1756 SdfLayerHandle _self;
1759 SdfFileFormatConstPtr _fileFormat;
1768 mutable Sdf_IdentityRegistry _idRegistry;
1771 SdfAbstractDataRefPtr _data;
1774 SdfLayerStateDelegateBaseRefPtr _stateDelegate;
1786 std::atomic<bool> _initializationComplete;
1790 boost::optional<bool> _initializationWasSuccessful;
1793 mutable bool _lastDirtyState;
1796 std::unique_ptr<Sdf_AssetInfo> _assetInfo;
1799 mutable VtValue _assetModificationTime;
1806 mutable size_t _mutedLayersRevisionCache;
1810 mutable bool _isMutedCache;
1813 bool _permissionToEdit;
1814 bool _permissionToSave;
1817 bool _validateAuthoring;
1827 friend class Sdf_ChangeManager;
1830 template <
class ChildPolicy>
friend class Sdf_ChildrenUtils;
1842 PXR_NAMESPACE_CLOSE_SCOPE
1844 #endif // PXR_USD_SDF_LAYER_H SDF_API void SetSessionOwner(const std::string &owner)
Sets the layer's session owner.
SDF_API void SetStateDelegate(const SdfLayerStateDelegateBaseRefPtr &delegate)
Sets the state delegate used to manage this layer's authoring state.
SDF_API bool HasEndTimeCode() const
Returns true if the layer has an endTimeCode opinion.
std::vector< SdfNamespaceEditDetail > SdfNamespaceEditDetailVector
A sequence of SdfNamespaceEditDetail.
A scene description container that can combine with other such containers to form simple component as...
SDF_API void SetCustomLayerData(const VtDictionary &value)
Sets the CustomLayerData dictionary associated with this layer.
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 SdfDataRefPtr GetMetadata() const
Returns the data from the absolute root path of this layer.
SDF_API VtValue GetField(const SdfPath &path, const TfToken &fieldName) const
Return the value for the given path and fieldName.
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 bool IsMuted() const
Returns true if the current layer is muted.
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.
SDF_API void SetHasOwnedSubLayers(bool)
Sets whether the layer's sublayers are expected to have owners.
SDF_API void SetEndTimeCode(double endTimeCode)
Sets the layer's end timeCode.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
A work dispatcher runs concurrent tasks.
SDF_API bool ExportToString(std::string *result) const
Writes this layer to the given string.
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 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 GetStartTimeCode() const
Returns the layer's start timeCode.
SDF_API void UpdateAssetInfo()
Update layer asset information.
SDF_API bool Save(bool force=false) const
Returns true if successful, false if an error occurred.
SDF_API bool IsDirty() const
Returns true if the layer is dirty, i.e.
SDF_API bool HasSessionOwner() const
Returns true if the layer has a session owner opinion.
SDF_API void RemoveRootPrim(const SdfPrimSpecHandle &prim)
Remove a root prim.
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 std::string GetOwner() const
Returns the layer's owner.
SDF_API std::string GetComment() const
Returns the comment string for this layer.
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.
A type-erased container for a field value in an SdfAbstractData.
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 const VtValue & GetAssetInfo() const
Returns resolve information from the last time the layer identifier was resolved.
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...
SDF_API bool HasStartTimeCode() const
Returns true if the layer has a startTimeCode opinion.
Base class for all Sdf spec classes.
SDF_API bool HasFramesPerSecond() const
Returns true if the layer has a frames per second opinion.
SDF_API void ClearCustomLayerData()
Clears out the CustomLayerData dictionary associated with this layer.
SDF_API const FileFormatArguments & GetFileFormatArguments() const
Returns the file format-specific arguments used during the construction of this layer.
static SDF_API std::set< std::string > GetMutedLayers()
Returns the set of muted layer paths.
SDF_API double GetFramesPerSecond() const
Returns the layer's frames per second.
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 std::string GetDocumentation() const
Returns the documentation string for this layer.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
SDF_API int GetFramePrecision() const
Returns the layer's frame precision.
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 bool ImportFromString(const std::string &string)
Reads this layer from the given string.
SDF_API bool HasOwner() const
Returns true if the layer has an owner opinion.
SDF_API std::set< std::string > GetCompositionAssetDependencies() const
Return paths of all assets this layer depends on due to composition fields.
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 VtDictionary GetCustomLayerData() const
Returns the CustomLayerData dictionary associated with this layer.
SDF_API bool HasTimeCodesPerSecond() const
Returns true if the layer has a timeCodesPerSecond 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 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 SdfLayerStateDelegateBasePtr GetStateDelegate() const
Returns the state delegate used to manage this layer's authoring state.
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 bool PermissionToEdit() const
Returns true if the caller is allowed to modify the layer and false otherwise.
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 SdfNameOrderProxy GetRootPrimOrder() const
Returns the list of prim names for this layer's reorder rootPrims statement.
SDF_API SdfLayerHints GetHints() const
Return hints about the layer's current contents.
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 const ArResolvedPath & GetResolvedPath() const
Returns the resolved path for this layer.
SDF_API bool IsAnonymous() const
Returns true if this layer is an anonymous layer.
SDF_API RootPrimsView GetRootPrims() const
Returns a vector of the layer's root prims.
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 bool IsEmpty() const
Returns whether this layer has no significant data.
SDF_API void SetColorConfiguration(const SdfAssetPath &colorConfiguration)
Sets the color configuration asset-path for this layer.
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 const SdfSchemaBase & GetSchema() const
Returns the schema this layer adheres to.
Represents a single list of list editing operations.
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.
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.
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.
static SDF_API void AddToMutedLayers(const std::string &mutedPath)
Add the specified path to the muted layers set.
SDF_API TfToken GetColorManagementSystem() const
Returns the color management system used to interpret the color configuration asset-path authored in ...
The fully-typed container for a field value in an SdfAbstractData.
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())
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 const std::string & GetRepositoryPath() const
Returns the layer identifier in asset path form.
SDF_API TfToken GetDefaultPrim() const
Return the defaultPrim metadata for this layer.
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.
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 void SetPermissionToEdit(bool allow)
Sets permission to edit.
SDF_API std::set< std::string > GetExternalReferences() const
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.
SDF_API SdfNamespaceEditDetail::Result CanApply(const SdfBatchNamespaceEdit &, SdfNamespaceEditDetailVector *details=NULL) const
Check if a batch of namespace edits will succeed.
SDF_API const std::string & GetVersion() const
Returns the asset system version of this layer.
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 SdfPrimSpecHandle GetPseudoRoot() const
Returns the layer's pseudo-root prim.
SDF_API void InsertInRootPrimOrder(const TfToken &name, int index=-1)
Adds a new root prim name in the root prim order.
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 SdfSubLayerProxy GetSubLayerPaths() const
Returns a proxy for this layer's sublayers.
SDF_API bool HasColorManagementSystem() const
Returns true if colorManagementSystem metadata is set in this layer.
SDF_API std::string GetDisplayName() const
Returns the layer's display name.
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 std::string GetFileExtension() const
Returns the file extension to use for this layer.
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.
Represents a resolved asset path.
SDF_API SdfLayerOffset GetSubLayerOffset(int index) const
Returns the layer offset for the subLayer path at the given index.
SDF_API bool HasCustomLayerData() const
Returns true if CustomLayerData is authored on the layer.
SDF_API const SdfFileFormatConstPtr & GetFileFormat() const
Returns the file format used by this layer.
SDF_API void Clear()
Clears the layer of all content.
Contains an asset path and an optional resolved path.
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 const std::string & GetRealPath() const
Returns the resolved path for this layer.
SDF_API std::vector< TfToken > ListFields(const SdfPath &path) const
Return the names of all the fields that are set at path.
SdfSpecType
An enum that specifies the type of an object.
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 const std::string & GetAssetName() const
Returns the asset name associated with this layer.
SDF_API void SetDefaultPrim(const TfToken &name)
Set the default prim metadata for this layer.
SDF_API bool HasSpec(const SdfPath &path) const
Return whether a spec exists at path.
SDF_API void ClearColorManagementSystem()
Clears the 'colorManagementSystem' metadata authored in this layer.
SDF_API void ClearFramePrecision()
Clear the framePrecision opinion.
T GetFieldAs(const SdfPath &path, const TfToken &fieldName, const T &defaultValue=T()) const
Return the value for the given path and fieldName.
SDF_API void ClearDefaultPrim()
Clear the default prim metadata for this layer.
SdfLayer(const SdfLayer &)=delete
Noncopyable.
SDF_API size_t GetNumSubLayerPaths() const
Returns the number of sublayer paths (and offsets).
SDF_API bool HasFramePrecision() const
Returns true if the layer has a frames precision opinion.
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.
Contains hints about layer contents that may be used to accelerate certain composition operations.
SDF_API double GetTimeCodesPerSecond() const
Returns the layer's timeCodes per second.
Provides a view onto an object's children.
SDF_API SdfAttributeSpecHandle GetAttributeAtPath(const SdfPath &path)
Returns an attribute at the given path.
Maintains authoring state information for an associated layer.
SDF_API void SetDocumentation(const std::string &documentation)
Sets the documentation string 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 SdfAssetPath GetColorConfiguration() const
Returns the color configuration asset-path for 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.
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.
Represents a time offset and scale between layers.
SDF_API bool GetHasOwnedSubLayers() const
Returns true if the layer's sublayers are expected to have owners.
SDF_API std::string GetSessionOwner() const
Returns the layer's session owner.
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 double GetEndTimeCode() const
Returns the layer's end timeCode.
SDF_API bool HasColorConfiguration() const
Returns true if color configuration metadata is set in this layer.
SDF_API bool Import(const std::string &layerPath)
Imports the content of the given layer path, replacing the content of the current layer.
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.
Enable a concrete base class for use with TfWeakPtr.
static SDF_API void RemoveFromMutedLayers(const std::string &mutedPath)
Remove the specified path from the muted layers set.
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 SdfSpecType GetSpecType(const SdfPath &path) const
Return the spec type for path.
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.
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 void ClearStartTimeCode()
Clear the startTimeCode opinion.
SDF_API void SetTimeCodesPerSecond(double timeCodesPerSecond)
Sets the layer's timeCodes per second.
Interface for scene description data storage.
SDF_API const std::string & GetIdentifier() const
Returns the layer identifier.
Contains information about a resolved asset.
SDF_API SdfLayerOffsetVector GetSubLayerOffsets() const
Returns the layer offsets for all the subLayer paths.
static SDF_API SdfLayerRefPtr CreateAnonymous(const std::string &tag=std::string(), const FileFormatArguments &args=FileFormatArguments())
Creates a new anonymous layer with an optional tag.