I have a Reality Composer
scene and I want to extract it as usdz
file or any files that can be used in ARQuickLook
?
is it possible?
2 Answers
At build time, Xcode compiles your .rcproject
into a .reality
file, and AR Quick Look accepts preview items of type .reality
. Here's an example that uses AR Quick Look to preview the Experience.rcproject
taken from Apple's SwiftStrike TableTop sample code:
import UIKit
import QuickLook
import ARKit
class ViewController: UIViewController, QLPreviewControllerDataSource {
override func viewDidAppear(_ animated: Bool) {
let previewController = QLPreviewController()
previewController.dataSource = self
present(previewController, animated: true, completion: nil)
}
func numberOfPreviewItems(in controller: QLPreviewController) -> Int { return 1 }
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
guard let path = Bundle.main.path(forResource: "Experience", ofType: "reality") else { fatalError("couldn't find the rcproject file.") }
let url = URL(fileURLWithPath: path)
let item = ARQuickLookPreviewItem(fileAt: url)
return item
}
}

- 4,040
- 1
- 29
- 29
From Apple's Creating 3D Content with Reality Composer document:
You can also save your composition to a .reality file for use as a lightweight AR Quick Look experience in your app or on the web. This allows users to place and preview content in the real world to get a quick sense of what it’s like.
To create a Reality file, choose File > Export > Export Project in the Reality Composer menu, and provide a name for the file. You use the Reality file that gets stored to disk just like you would use a USDZ file, as described in Previewing a Model with AR Quick Look.
-
Oh, again my bad, I've tried that, because I've read the Apple article that you mentioned, I just realised it was on a wrong phone (not iOS 13) since it's only supported on iOS 13. Thanks. – Mina Jun 12 '19 at 07:28
-
What is the difference between a USDZ file and a .reality file? Is there anything a .reality file can do that can't be done with USDZ? – JJ. Jun 30 '19 at 21:30