This sample demonstrates how to open/create a stage with key metadata and set prim display names using the OpenUSD Exchange SDK.
OpenUSD has strict requirements on what names are valid for a UsdObject. There is support for storing a "Display Name" as metadata on a Prim.
- Exchange SDK documentation on display names
- OpenUSD documentation on UsdObject display names
- OpenUSD GitHub PR for displayName metadata
This sample introduces the createCone()
and createCylinder()
utilies for creating UsdGeomGprims. They provide useful arguments, set extents (as required by these classes), and set custom Omniverse RTX refinement attributes.
This sample creates a multi-prim component rocket which users may wish to be selectable as a single object. Many USD viewers support model selection hierarchy so the "rocket" Xform is assigned a component kind.
The Gf, Sdf, Usd, and UsdGeom modules are used.
- computeEffectiveDisplayName()
- createStage()
- getValidChildNames()
- get/setDisplayName()
- saveStage()
This sample is implemented in both C++ and Python. To run:
[./]run.[bat, sh] setDisplayNames
[./]python.[bat, sh] source/setDisplayNames/setDisplayNames.py
- Make a rocket with interesting part display names using 🚀
Usage:
setDisplayNames [OPTION...]
-a, --usda Output a text stage rather than binary
-h, --help Print usage
-p, --path arg Alternate destination stage path (default: c:/Users/username/AppData/Local/Temp/usdex/sample.usdc)