Apple AR Quick Look apparently only supports .usdz files. Is there a way to convert an .obj or .stl to .usdz?
I googled this first but the most popular result was to use a free tool called Vectary, but when I actually tried to use it, it wasn’t free.
16 Answers
With iOS 13 & Reality Kit, Apple has released a USDZ converter that does not require Xcode; the converter is a Python based tool. I have been using it the last few days to convert various files gltf, obj files.
Download link:
Example usage:
usdzconvert someobject.obj You will want to edit paths for your environment variables.
Or double click the file which is in the top level of the folder:
USD.commandto launch a shell with the environment variables set.
And within Xcode 11, you can export SCN files to USDZ files.
It is well worth watching the WWDC 2019 video; it is just over 30 minutes:
1If you're using Xcode 12 and Xcode 11, you can utilise the following command in Terminal:
usdzconvert ~/Desktop/file.objusdzconvert command is a Python script that converts .obj, .gltf, .fbx, .abc, .usda, .usdc, and .usd assets to usdz.
And if you wanna use this command in Terminal, you need to download usdz Tools from HERE.
In case you're using Xcode 10, type the following command in Terminal:
xcrun usdz_converter ~/Desktop/file.obj ~/Desktop/file.usdzFor further details look at THIS POST and THIS POST.
18If you're using Xcode, this is the easiest solution
Open the file in Xcode, then go to File > Export... and choose the file type (.usdz is 'Universal Scene Description (Mobile)'):
Apple released a tool called Reality Converter that has an interface which allows you to convert your .obj, .gltf and .usd files into .usdz
Check it out:
Anything you upload to sketchfab.com is automatically converted to usdz (and gltf), and Sketchfab supports more than 30 formats as an input, including obj, fbx, stl, dae, blend...
In case you want to convert on the device (no XCode required):
import modelIO
import SceneKit
let asset = MDLAsset(url: objURL)
let scene = SCNScene(mdlAsset: asset)
scene.write(to: usdzURL, delegate: nil, progressHandler: nil)This might not work for everyone since it did not load the materials properly. In my case, it was not a big issue to manually set the materials in RealityKit. I also do not know how it handles animations. Another poster mentioned converting to .usdc and renaming to .usdz but I could not get this to work. (link here)
Other ways to convert to .usdz: