Getting Started in Python#
During Early Access, use 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.
The first time you run a program built against ovrtx, it compiles and caches necessary shaders, which may take some time depending on your system. Subsequent runs use the cached shaders and are faster.
Minimal Example#
import sys
import ovrtx
from PIL import Image
USD_URL = "https://omniverse-content-production.s3.us-west-2.amazonaws.com/Samples/Robot-OVRTX/robot-ovrtx.usda"
def main():
# Create the Renderer and load a USD layer into it
print("Creating renderer. The first run of the application will take some time as shaders are compiled and cached...", file=sys.stderr)
renderer = ovrtx.Renderer()
print("Renderer created.", file=sys.stderr)
print(f"Adding {USD_URL} at root...", file=sys.stderr)
renderer.add_usd(USD_URL)
print("USD loaded.", file=sys.stderr)
# Step the renderer to simulate the Camera at 60Hz
print("Stepping renderer...", file=sys.stderr)
products = renderer.step(
render_products = {"/Render/Camera"},
delta_time = 1.0 / 60
)
print("Stepped renderer.", file=sys.stderr)
# Get the Camera output for the step as a numpy array and display it
print("Fetching results...", file=sys.stderr)
for _product_name, product in products.items():
for frame in product.frames:
with frame.render_vars["LdrColor"].map(device=ovrtx.Device.CPU) as var:
pixels = var.tensor.numpy()
Image.fromarray(pixels).show()
print("Fetched results.", file=sys.stderr)
if __name__ == "__main__":
main()
The example above is provided as a Python project in the examples/python/minimal directory in the repository.
Next Steps#
Explore more Examples including the Planet System demo with GPU-accelerated animation.
See the Python API Reference for the full Python API.