Updating USDZ command line tools for Apple Silicon

I mentioned in a previous post that at WWDC this year Apple revamped Reality Converter and the associated USDZ command line tools to run natively on Apple Silicon. Further investigation has shown this not to be entirely correct.

The change was announced in the video Explore USD tools and rendering, but although Reality Converter now supports Apple Silicon without resorting to Rosetta 2 emulation, USDZ command line tools have a dependancy on an older non-universal Python 3.7 library. The first version of Python to support Apple Silicon was the later 3.9.1.

Digging deeper, it looks as though the problem is actually related to Autodesk and their FBX Software Developer Kit. Reality Converter relies on Autodesk's C++ SDK which has been updated with Apple Silicon support, whereas USDZ tools are dependant on the Python SDK. This is still stuck on Python 3.7.

Presumably at the time of recording the WWDC video, the assumption was an update to Autodesk's toolset would be available.

I don't personally need FBX model conversion, so I recompiled the USD library on Apple Silicon and now I have full support for the tools running on an M1 Mac.

Augmented reality view of a runway edge light.

The process is straightforward. Using Homebrew package manager, install the latest supported versions of Python 3 and CMake. Clone the USD repository and run the following terminal command:

python3.9 USD/build_scripts/build_usd.py --build-args TBB,"arch=arm64" --python --no-imaging --docs --no-usdview --build-monolithic usdpython

Once built, copy the contents of the resulting usdpython/lib directory and replace the usdpython/USD/lib directory Apple's installer created. Finally edit the first line of the usdzconvert script to read:

#!/usr/bin/env python3.9

Running usdzconvert as normal should work without the need to install older libraries or deal with Rosetta emulation.