combining-scene-with-runtime-prims
Combining a Scene with Runtime Prims
Overview
ovrtx only supports one root layer per renderer. Documentation tests often need a base scene (for cameras, lights, geometry, and materials) plus doc-specific prims such as RenderProduct or RenderVar definitions. For that case, use open_usd_from_string() / ovrtx_open_usd_from_string() with an inline root USDA layer that contains a subLayers composition arc to the base scene and authors the extra prims in the same root layer.
This inline sublayer pattern is supported and is the preferred docs-test pattern when the code example needs to demonstrate a single composed stage. Use add_usd_reference* only when the example specifically needs to add or remove referenced content after a root stage is already open.
The Pattern
Build one inline root USDA string that:
- Uses
subLayers = [@/path/to/base_scene.usda@]to bring in the actual scene content. - Authors the extra doc-specific prims in the same inline root layer.
- Is loaded with
open_usd_from_string()in Python orovrtx_open_usd_from_string()in C.
Python source:
tests/docs/python/test_sensor_configuration.pysnippetdoc-add-render-config-layerC source:
tests/docs/c/test_sensor_configuration.cppsnippetdoc-add-render-config-layer-c