How to export an .obj file in stead of .usdz?

From the keynote #10076 it was mentioned at the 3:00 mark, that USDZ, USDA and OBJ is supported, but I've not been able to find details on how to make the sample command-line app export .obj files. Only .usdz.

Anyone have any information on that?

Or does anyone have any tips on how to convert a .usdz to .obj? It doesn't seem to be very easy to do.

I didn't see any way in RealityFoundation to do this, but you can easily convert it using the ModelIO Framework. At line 89 after the processing is complete. You can add this chunk of code:

          print("Processing is complete!")
          let objPath = <#Your OBJ Path#>
          let modelAsset = MDLAsset(url: URL(fileURLWithPath: outputFilename))
          modelAsset.loadTextures()
          do {
            try modelAsset.export(to:URL(fileURLWithPath: objPath))
            print("Exported to OBJ!")	
          }
          catch {
            print(error)
          }

If you open the .usdz file using the native xcode viewer, you can export it as a DAE file. From there, you can import the model into blender, and then convert it into obj. Here is a video I made that shows the process: https://www.youtube.com/watch?v=6AQJuKr46rA

I believe there is a blender plugin to import .usdz files out the gate, but I was not able to get it to run.

For those who are still keeping an eye on this.

Apple's object capture is available on iOS. And it can output .obj file if the the url passed to ".modelFile" is a directory.

However, any URL created is not treated as a directory by default. You need to specify it explicitly like this: newFolder.appendingPathComponent("Models/", isDirectory: true)

How to export an .obj file in stead of .usdz?
 
 
Q