getUsdLayerEncoding#
Fully qualified name: usdex::core::getUsdLayerEncoding
- pxr::TfToken usdex::core::getUsdLayerEncoding(
- const pxr::SdfLayerHandle layer,
Get the USD file format encoding of the given
SdfLayer.SdfLayerscan be written in several formats, the most common of which is.usd. However, any.usdfile could be either USDA encoded (human-readable text) or USDC encoded (a binary Crate encoding).Both encodings are also available as their own dedicated file extensions (
.usdaand.usdc), which can help clarify the intent of content and prevent encoding mistakes.This function returns the USD file format encoding of the given
SdfLayer. It will return “usda”, “usdc”, or “usd” for valid USD layers, and an empty token for any other file format (i.e. 3rd partySdfFileFormatPluginlayers).- Parameters:
layer – The layer to get the USD file format encoding of.
- Returns:
The USD file format encoding of the layer, or an empty token if the layer is not a valid USD layer.