USD Viewport with pyside6

Hello,
I am just starting with USD and I am trying to create a viewport in a python application.

Based on this page, I built OpenUSD following this guideline to have it built with my version of python and pyside, on Windows 10.

My version of python is 3.11.9 and here is what comes out with pip freeze:

distlib==0.3.7
filelock==3.13.1
numpy==1.26.2
opencv-python==4.8.1.78
Pillow==10.1.0
platformdirs==3.11.0
PyOpenGL==3.1.5
PySide6==6.6.0
PySide6-Addons==6.6.0
PySide6-Essentials==6.6.0
shiboken6==6.6.0

I got a working viewport that can display a USD file when it opens, but as soon as I try to move in the viewport, it becomes grey like that:

I have tried different versions of python, from 3.9 to 3.12. I can’t have OpenUSD to build correctly with 3.9 and 3.10.
I initially had pyopengl==3.1.7 and thought it was the issue, 3.1.5 made the problem grey instead of black.

Do you have an idea where it can potentially comes from ? Or where I should look next ?

Cheers !

edit:
And if I try to open a USD file with the built usdview, it opens and I get all the informations but the viewport is entirely grey as well.

Based on this page ,

Good to see my legacy code still being useful. :slight_smile:


Do you get any command line output when running it when getting that odd view? I feel like the code may be raising some warnings? It’s usually quite verbose already.

Also, what you could try is using the USD binaries of Nvidia which are currently for Py 3.10. But if those do work for you and also render fine - then it maybe highlights at least that it may not be due to your USD build itself.

And as always when glitches/bugs appear in the way things render. Are you on a laptop or machine that may have multiple GPUs (e.g. a light-weight battery saving GPU and a heavier one?). If so, there may be a chance that if you enforce it to use the higher performance GPU that it works. Not related to USD but with regards to GL rendering that’s something I’ve traditionally seen coming up with other tools, that can look similarly glitchy.

Well that’s the only example I could find haha :smiley:

Thanks for the help !
Unfortunately I don’t have any warning, but the NVidia version works fine without any glitch.

Could it be because of Pyside6 ? The NVidia version is for Pyside2, and in the USD Documentation they only tested it with Pyside2 on Windows :confused:

Regarding the hardware I only have one graphics card so I guess that’s not an issue :slight_smile:

edit:
I just tried building it myself with the same spec as NVidia (python3.10 and pyside2) and it works just fine, so might be possible that later version of python and pyside are not yet supported on Windows ?

I am having the exact same problem, and am rebuilding with PySide2 now to double check. Unfortunately, this is blocking me from trying python 3.11, as PySide2 is no longer available there. Please keep us posted if you find the issue and I’ll do the same.

Cheers,
Koen

For the moment I switched back to python 3.10 and pyside2, I think we’ll have to wait until it is compatible with later versions :confused:

Hello,
I have a working PySide6 USD Hydra project here:

I heavily borrow @BigRoyNL 's code.
The project uses it’s own python environment, but imports the compiled USD python libraries. This way you can install whatever libraries you need into your custom environment and rely on the USD environment for Hydra.

1 Like