What Is USDZ and How To Convert Your 3D Model to USDZ
Universal Scene Description — a file format for 3D models, introduced by Apple and Pixar
USDZ stands for Universal Scene Description. It is a file format for 3D models, introduced by Apple in collaboration with Pixar for its ARKit.
One can use ARQuickLook
, which handles the task of rendering the model into the environment, taking care of light conditions, scanning the surface, placing the object into the environment, and holding its place even when the camera moves around. In case you’re interested about ARQuickLook, you can read this article for more information.
In short, ARQuickLook
and usdz
can take care of all the things that are required to give the experience of Augmented Reality to your user. This format is supported on iOS, macOS, and tvOS.
USDZ is a compact single file, containing all the information about the mesh data, binary data, and textures of a model, so you don’t have to worry about stitching the details of your model every time you want to transfer to another system or render it.
The anatomy of a USDZ file can be understood from the following figure:
When I started working on AR (Augmented Reality), I really felt the need of having a single file, containing all the information related to my model. Well, Apple has done the job quite perfectly in collaboration with Pixar.
Until last year, converting your existing model to USDZ was a really hard task because only Xcode( an IDE for developing softwares related to Apple) had the capability to convert it via terminal for some specific file formats but it was not capable to convert from major model formats to .usdz
.
But, in WWDC 2019, Apple introduced a new tool to convert existing models from any major format available in the market to USDZ. It is a command-line tool which is based on Python, thus becoming platform-independent.
It has other capabilities like validating 3D assets, seeing data in plain text form, managing mesh data and adding attributes to nodes. For more detailed information, I suggest going through this WWDC 2019 session.
Now, to convert your existing model to USDZ, you need to download the Python tool from the link (you can download the tool by logging in with your Apple ID, since it’s an early developer tool). I have downloaded the tool version USDPYTHON 0.62 and going to run this on macOS 10.14.5. After downloading, you’ll get a folder named “usdpython 0.62”, I have also dragged my folder on my desktop (for no apparent reason), open the folder you can see lot of files in the folder, no need to get confused, I am going to walk you through the entire process.
Double click on USD.command
file in the folder to open it (which is of kind Terminal Shell Script), it will open your terminal like this:
Navigate to the directory where you have kept your model, for those of you who’re not aware of how to navigate to a folder in Terminal, I have kept mine model to convert on my Desktop in a folder named demo so i’ll have to type cd Desktop/demo
and hit enter . You can see in the image below for reference:
My folder contains a model of glTF format and its textures, which I have downloaded from Sketchfab for this demo.
You can explore Sketchfab and download free 3D models, in case you don’t have any 3D model and want to test this tool. You can see the content of my model folder in the image below:
Type usdzconvert inputFile
or usdzconvert inputFile [outputFile]
and press enter. You can see the image below for reference:
You will start seeing the conversion and asset validation in the terminal. You’ll get this message after the completion of the conversion:
And boom!!!, your model got converted to the USDZ format, containing all the details, information, and textures along with it. Now you don’t need to have your texture files separately. You can go to the same folder and see there will be file of .usdz
extension (in my case it’s scene.usdz). For reference, you can see the image below:
If you still want to edit something, you can use Xcode to do all your changes or your same software that you used to make your model(if you’re into that stuff).
If you are using a macOS for this task and want to take a quick glance at your converted model, select the model and hit space on your Mac, it’ll open the model for you in QuickLook, you can play around with your model in QuickLook. You can also put this in your iPhone and view it in ARQuickLook.
You can also provide details to your models, such as diffuse color, roughness, metallic texture, etc. from this tool, like this:
Now, if you are using any software to build models and don’t want to perform all these things to do the conversion, you can find plugins which will help you in exporting directly to USDZ on the Pixar website.
For more information, I suggest you watch this demo on WWDC 2019. I hope this helps in solving your problem converting the models to USDZ, let me know if you have any difficulties. Thanks for reading and feel free to reach out in case of any queries.
EDIT:- The tool I have used to convert 3D model has multiple versions now, i’ll try to keep editing the article with the latest version of the tool, for now you can definitely get your work done with the version I have mentioned in the article.