Skip to content

Instantly share code, notes, and snippets.

@meshula
Last active June 26, 2022 22:34
Show Gist options
  • Select an option

  • Save meshula/11100bdab27ee85014fb55f202f4388b to your computer and use it in GitHub Desktop.

Select an option

Save meshula/11100bdab27ee85014fb55f202f4388b to your computer and use it in GitHub Desktop.
usd/conda/m1/20220620

SON OF USD BUILD CLUB

Building a native Apple Silicon version of UsdView

This version of UsdView will have an Apple Silcon, Metal-native viewer, openimageio, and alembic support. It does not yet include MaterialX, OpenColorIO, or any of the other many options build_usd.py supports.

Successfully get usdview running on conda and M1 as follows:

Using the PySide6 PR by Jon Creighton

PixarAnimationStudios/OpenUSD#1898

and adding the jwarren patch, which is required for Conda, or python when installed by homebrew:

https://github.com/jwarrencode/USD/commit/c8432e7235cd25f0a6112f2b39e3ee2224fb4432

If you are using conda, set up a clean environment:

conda create --prefix /usr/local/macusdview python=3.10
conda activate /usr/local/macusdview

In your python environment of choice, run the following, adjust paths as necessary.

pip install PyOpenGL
pip install PySide6
python ~/dev/USD/build_scripts/build_usd.py --openimageio /usr/local/macusdview/
install_name_tool -change libosdCPU.3.4.4.dylib @rpath/libosdCPU.3.4.4.dylib /usr/local/macusdview/lib/python/pxr/UsdImagingGL/_usdImagingGL.so
install_name_tool -change libosdGPU.3.4.4.dylib @rpath/libosdGPU.3.4.4.dylib /usr/local/macusdview/lib/python/pxr/UsdImagingGL/_usdImagingGL.so
usdview ~/dev/assets/M2BldgScareSchool.usdc
#tar -zcf macusdview-20220620-1.tgz /usr/local/macusdview/

If you want to add alembic to the build it should be possible now. Rerun the build script with the following modification:

python ~/dev/USD/build_scripts/build_usd.py --openimageio --alembic /usr/local/macusdview/

When the build completes, the alembic plugin should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment