Unable to export a captured RoomPlan

Hi! I'm currently doing a simple RoomCaptureView-based room capture (iOS 17, iPhone 15 super mega ultra pro max), and I'm unable to export anything I capture, even though I have a dollhouse I can play with after the export.

Attached is a screen grab of the doll-house expand/collapse view. (it always fails) My export code is in the RoomCaptureView delegate. The passed in error is nil.

    func captureView(didPresent processedResult: CapturedRoom, error: (Error)?) {
        let fm = FileManager()
        do {
            let documentDirectoryURL = try fm.url(for: .documentDirectory, 
                                                  in: .userDomainMask, 
                                                  appropriateFor: nil, 
                                                  create: true)
            let now = generateCurrentTimeStamp() // of the form 2023_10_02_09_45_58
            let destinationURL = documentDirectoryURL.appendingPathComponent("\(now).usdz")
            try processedResult.export(to: destinationURL)
        } catch {
            print("oops no processed result? \(error)")
        }
    }
  • The constructed URL is: file:///var/mobile/Containers/Data/Application/7DD98157-909A-40A1-9271-1AFCD5336E8B/Documents/2023_10_02_09_45_58.usdz
  • The error in the catch is (not sure where the rest of my path went...):
▿ Error
  ▿ cannotCreateNode : 1 element
    - path : "/2023_10_02_09_45_58"

And this is printed to the console: Warning: in SdfPath at line 151 of sdf/path.cpp -- Ill-formed SdfPath </2023_10_02_09_38_17>: syntax error Coding Error: in _IsValidPathForCreatingPrim at line 3338 of usd/stage.cpp -- Path must be an absolute path: <>

The same sequence happens if I use any of the different export types (mesh-default, parametric, model).

I'd attach my project but looks like zip files and dropbox links are forbidden here. If you want a small sample project, feel free to email me at markd at borkware dot com (since looks like emails are forbidden here too)

Thanks in advance! I'd love to present this to my cocoaheads in a couple of weeks.

Replies

Per Quinn's suggestion, TSI Case-ID: 4368872 submitted

@markd2 you got any solution for this.

[@Shiv Sharma](https://developer.apple.com/forums/profile/Shiv Sharma) DTS discovered if I used a filename with a non-number as its first character, then it exports (and was able to verify that and get exports)

It's a leaky abstraction, implementation details about UDSZ have escaped and affect our choice of filenames (courtesy of DTS: a requirement of the USD spec, see the documentation here: https://openusd.org/dev/api/group__group__tf___string.html#gaa129b294af3f68d01477d430b70d40c8)

Feedback reported: FB13240732