How to convert usdz to obj with code?

Use the  ModelIO

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

The exported obj is missing most of the information compared to the original usdz.

I am experiencing mostly the same with scanned models from RoomPlan. When the usdz is converted to obj, the obj file contains only one cube.

How to convert usdz to obj with code?
 
 
Q