Getting Started in Python#

During Early Access, we recommend using the uv Python package and project manager. All the examples in the repository contain pyproject.toml files that are tested with uv.

Python 3.10–3.13 is required.

To get started, first clone the repository and run the first example with uv:

git clone https://github.com/NVIDIA-Omniverse/ovrtx.git
cd ovrtx/examples/python/minimal
uv run main.py

The minimal example shows how to create the renderer, load an OpenUSD scene and render a single image, copying the results back to the CPU for display.

Minimal example output

Note that the first time a program built against ovrtx is run, it will compile and cache necessary shaders, which may take some time depending on your system. Subsequent runs will use the cached shaders and will be fast.

Minimal Example#

import ovrtx
from PIL import Image

def main():
    # Create the Renderer and load a USD layer into it
    renderer = ovrtx.Renderer()
    renderer.add_usd("https://omniverse-content-production.s3.us-west-2.amazonaws.com/Samples/Robot-OVRTX/robot-ovrtx.usda")

    # Step the renderer to simulate the Camera at 60Hz
    products = renderer.step(
        render_products = {"/Render/Camera"},
        delta_time = 1.0 / 60
    )

    # Get the Camera output for the step as a numpy array and display it
    for _product_name, product in products.items():
        for frame in product.frames:
            with frame.render_vars["LdrColor"].map(device="cpu") as var:
                pixels = var.tensor.numpy()
                Image.fromarray(pixels).show()

if __name__ == "__main__":
    main()

The example above is provided as a Python project in the examples/python/minimal directory in the repository.

Next Steps#