Python USD Viewer allows you to view OpenUSD files and convert VTK objects to OpenUSD objects.
The _VTKConverter class processes VTK assets by performing these steps:
- Reads the VTK file using the appropriate VTK reader.
- Converts the VTK geometry data to polydata (surface representation) or at least extracts the surface.
- Translates the VTK polydata to a USD mesh.
- Embeds the USD mesh into a USD stage for visualization.
Prerequisites
You must have a C++ compiler. Linux typically includes one by default. On Windows, you can use Visual Studio.
- Create a new Python environment for this repository:
pip install uv- Create a virtual environment and install the project:
uv venv .venv- Activate the environment:
# On Linux or macOS
source .venv/bin/activate# On Windows
.venv\Scripts\activate- Install the project:
uv sync- Set up OpenUSD using the OpenUSD auto-installer:
usd-setupOr, follow the instructions in the OpenUSD repository.
Python USD Viewer uses Maya-style controls. To move the camera with the mouse, press and hold the Alt key.