UsdStage Configuration#

Utility functions to provide consistant authoring of UsdStages

When authoring UsdStages it is important to configure certain metrics & metadata on the root SdfLayer of the stage. While this is trivial using various Usd and UsdGeom public methods, it is also easy to forget, and difficult to discover.

These functions assist authoring applications in setting stage metrics and authoring metadata (see SdfLayer Authoring), so that each application can produce consistant metadata on the SdfLayers it exports.

Functions#

bool usdex::core::configureStage(pxr::UsdStagePtr stage, const std::string &defaultPrimName, const pxr::TfToken &upAxis, const double linearUnits, std::optional< std::string_view > authoringMetadata=std::nullopt)

Configure a stage so that the defining metadata is explicitly authored.

pxr::UsdStageRefPtr usdex::core::createStage(const std::string &identifier, const std::string &defaultPrimName, const pxr::TfToken &upAxis, const double linearUnits, const std::string &authoringMetadata, const pxr::SdfLayer::FileFormatArguments &fileFormatArgs=pxr::SdfLayer::FileFormatArguments())

Create and configure a UsdStage so that the defining metadata is explicitly authored.

void usdex::core::saveStage(pxr::UsdStagePtr stage, std::optional< std::string_view > authoringMetadata=std::nullopt, std::optional< std::string_view > comment=std::nullopt)

Save the given UsdStage with metadata applied to all dirty layers.