Sublayer test scenes

From NVIDIA-Omniverse/ovrtx · View interactive version

Sublayer test scenes is an AI agent skill from the GitHub repository NVIDIA-Omniverse/ovrtx. Loading a base USD scene with additional runtime prims in tests. Use when a doc test needs to combine a scene file with RenderProducts or other prims that aren't in the original scene.

How to use this skill

Skill file

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:

  1. Uses subLayers = [@/path/to/base_scene.usda@] to bring in the actual scene content.
  2. Authors the extra doc-specific prims in the same inline root layer.
  3. Is loaded with open_usd_from_string() in Python or ovrtx_open_usd_from_string() in C.

Python source: tests/docs/python/test_sensor_configuration.py snippet doc-add-render-config-layer

C source: tests/docs/c/test_sensor_configuration.cpp snippet doc-add-render-config-layer-c

Why This Works

USD subLayers is a composition arc that layers multiple USD files into a single stage. The inline USDA becomes the "stronger" layer (opinions win), and the sublayered scene file provides the base content. ovrtx sees this as one root layer containing everything.

Key Details

Common Pitfalls

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.