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.

Replies

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)
          }
  • Could you maybe share the whole file? I guess you had to make more changes to convert it from RealityFoundation to the Modell IO Framework. I was also wondering because at line 89 in the HelloPhotogrametry code there is something else happening.

    I'm new to swift and macOS framworks so that would be really helpful.

Add a Comment

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.

  • sadly import doesn't work yet on blender, at least not officially. they can export usda and usdc but not import

  • there is an alpha with USD import: https://builder.blender.org/download/experimental/blender-2.93.0-alpha+usd-importer-T81257-merge.e8306114382b-windows.amd64-release.zip

Add a Comment