SdfLayer Algorithms
Utility functions to manipulate SdfLayers
Functions
- bool omni::connect::core::exportLayer(pxr::SdfLayerHandle layer, const std::string &identifier, const char *comment=nullptr, const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments())
Export the given
SdfLayer
to an identifier with an optional comment.- bool omni::connect::core::hasLayerAuthoringMetadata(pxr::SdfLayerHandle layer)
Check if the
SdfLayer
has metadata indicating the provenance of the data.- void omni::connect::core::saveLayer(pxr::SdfLayerHandle layer, const char *comment=nullptr)
Save the given
SdfLayer
with an optional comment.- void omni::connect::core::setLayerAuthoringMetadata(pxr::SdfLayerHandle layer)
Set metadata on the
SdfLayer
indicating the provenance of the data.
Functions
-
bool omni::connect::core::exportLayer(pxr::SdfLayerHandle layer, const std::string &identifier, const char *comment = nullptr, const pxr::SdfLayer::FileFormatArguments &fileFormatArgs = pxr::SdfLayer::FileFormatArguments())
Export the given
SdfLayer
to an identifier with an optional comment.Note this does not impact sublayers or any layers that this layer may be contributing to.
The comment will be authored in the layer as the SdfLayer comment.
If the layer is being exported to an Omniverse Nucleus server with checkpoints enabled, then the comment will be added to the checkpoint.
- Parameters
layer – The layer to be exported.
identifier – The identifier to be used for the new layer.
comment – The comment.
fileFormatArgs – Additional file format-specific arguments to be supplied during layer export.
- Returns
A bool indicating if the export was successfully.
-
bool omni::connect::core::hasLayerAuthoringMetadata(pxr::SdfLayerHandle layer)
Check if the
SdfLayer
has metadata indicating the provenance of the data.Important: this metadata is strictly informational, it is not advisable to key runtime behavior off of this metadata.
- Parameters
layer – The layer to check
-
void omni::connect::core::saveLayer(pxr::SdfLayerHandle layer, const char *comment = nullptr)
Save the given
SdfLayer
with an optional comment.Note this does not impact sublayers or any stages that this layer may be contributing to. This is to preserve authoring metadata on referenced layers that came from other applications. See SdfLayer Algorithms for more details on
setLayerAuthoringMetadata
.The comment will be authored in the layer as the SdfLayer comment.
If the layer is being exported to an Omniverse Nucleus server with checkpoints enabled, then the comment will be added to the checkpoint.
- Parameters
layer – The layer to be saved.
comment – The comment.
-
void omni::connect::core::setLayerAuthoringMetadata(pxr::SdfLayerHandle layer)
Set metadata on the
SdfLayer
indicating the provenance of the data.Important: this metadata is strictly informational, it is not advisable to key runtime behavior off of this metadata.
This will add information to the layer that can be used to track it back to its product of origin. The mandatory settings
/app/name
,/app/version
,/omni.connect.core/client/name
, and/omni.connect.core/client/version
are used to format the metadata.Note
startup()
must be called before calling this function.- Parameters
layer – The layer to modify