Convert .scn to USDZ from within an app

Has ANYONE successfully exported a programmatically created .scn to USDZ from within your app?

I have been waiting for this since the beginning of time from Apple, but so far I have found nothing.

Goal: create a scene programmatically, convert scene to used, export....

I would like to know where we stand with this.

Thanks
I've tried this for quite a while also and it has never worked well. A USDZ file is exported, but it's usually useless because there are so many bugs (which I've reported). It would be great if someone at Apple actually worked on this, but so far it doesn't seem to get much love. Here's a quick example of how to at least try it:

Code Block     // Make a USDZ model file from the scene.
    func make3DModel(fileName: String) -> URL? {
        let sceneURL = URL(fileURLWithPath: NSTemporaryDirectory() + fileName + ".usdz")
        let options: [String: Any] = [SCNSceneExportDestinationURL: URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)]
        if sceneView.scene?.write(to: sceneURL, options: options, delegate: self, progressHandler: {(progress, error, stop) in
            if let error = error {
                NSLog("ShareScene \(String(describing: error))")
            }
        }) != true {
            NSLog("ShareScene Unable to write scene to \(sceneURL)")
            return nil
        }
        return sceneURL
    }


Convert .scn to USDZ from within an app
 
 
Q