0

I'm using AR Quick Look. I have a Reality Composer scene (.rcproject) in my project. I'd like to add a variety of entities to the .rcproject, define triggers and actions AND add a USDZ file from a file at run time.

I can load a remote USDZ file into a QLPreviewController and display it fine as the single QLPreviewItem. I have the URL, covert it to a local file then open it as a preview item.

There are lots of examples of adding entities to an ARView.

But I do not see how I can have a scene defined in Xcode (.rcproject), that I edited with Reality Composer, add a entity (e.g. USDZ file) at run time and display the revised reality file using QLPreviewController and QLPreviewItem.

I can Entity.load(contentsOf: url) to load the .rcproject scene, get the anchor and add a child, which is the USDZ file I got from a remote URL and converted to a local file, but then how do I save that back (the updated anchor or ???) to a .reality file and pass the temporary local file URL as a QLPreviewItem?

Or is there a way to add an entity (USDZ file) to a running QLPreviewController view at run time?

I'm trying to stay with QLPreviewController because I need users to be able to share this AR Quick Look view with other iPhone users so they can open the view in Safari on the iPhone without needing my app.

D. Rothschild
  • 659
  • 9
  • 14

0 Answers0