1

trying to export a sequence of OBJ from GARAugmentedFaceSession

In the following project, I just added the following code snippet to export OBJs; https://github.com/google-ar/arcore-ios-sdk/tree/master/Examples/AugmentedFacesExample

Into Ln 236 from FacesViewControllers.swift;

    // Added
    let mdlMesh = MDLMesh(scnGeometry: faceTextureNode.geometry!)
    let asset = MDLAsset()
    asset.add(mdlMesh)
    do {
        let directory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
        let obj_url = directory!.appendingPathComponent("test_\(id).obj")
        try asset.export(to: obj_url) // iOS14
        self.id += 1
    }
    catch {
        print("SCNSceneRendererDelegate:renderer :: Can't write mesh to url")
    }

The weird thing is it works fine in iOS13, but crashes in iOS14. I am using the latest version of ARCore,1.20.0

If I just use ARSCNFaceGeometry, it works fine. But I want to use GARAugmentedFaceSession for better results.

Any idea why it crashes on iOS14?

sean
  • 11
  • 1

1 Answers1

0

On provided screenshot in comments your directory url is nil

Veronika Babii
  • 324
  • 5
  • 18