addAssetContent#

Fully qualified name: usdex::core::addAssetContent

pxr::UsdStageRefPtr usdex::core::addAssetContent(
pxr::UsdStagePtr stage,
const std::string &name,
const std::string &format = "usda",
const pxr::SdfLayer::FileFormatArguments &fileFormatArgs = pxr::SdfLayer::FileFormatArguments(),
bool prependLayer = true,
bool createScope = true,
)#

Create a specific Content Layer and add it as a sublayer to the stage’s edit target.

Any Prim data can be authored in the Content Layer, there are no specific restrictions or requirements.

However, it is recommended to use a unique Content Layer for each domain (Geometry, Materials, Physics, etc.) and to ensure only domain-specific opinions are authored in that Content Layer. This provides a clear separation of concerns and allows for easier reuse of assets across domains as each layer can be enabled/disabled (muted) independently.

Parameters:
  • stage – The stage’s edit target will determine where the Content Layer is created and will have its subLayers updated with the new content

  • name – The name of the Content Layer (e.g., “Geometry”, “Materials”, “Physics”)

  • format – The file format extension (default: “usda”)

  • fileFormatArgs – Additional file format-specific arguments to be supplied during stage creation.

  • prependLayer – Whether to prepend (or append) the layer to the sublayer stack (default: true)

  • createScope – Whether to create a scope in the content stage (default: true)

Returns:

The newly created Content Layer opened as a new stage. Returns an invalid stage on error.