Modify Reality Composer Asset in code?

Hello, I’ve noticed that when I set the image of a picture frame asset in Reality Composer it will change its size and aspect ratio to match the image. That’s pretty nice!

I would like to let a user dynamically modify that picture while running the app. Is this possible? Or are the models properties you set in the composer locked in when you export?

Accepted Reply

This is unfortunately not possible: the code that generates the picture frame is part of Reality Composer itself and not RealityKit; when you export your project, the result is just a model and you cannot configure it anymore.

However, you could re-implement something similar to the picture frame by using the RealityKit APIs to create meshes and materials; the WWDC session "Explore advanced rendering with RealityKit 2" goes over creating meshes at the end.

  • Thank you very much! I appreciate how responsive you guys are on RealityKit topics. Modifying meshes was going to be my original approach until I saw how easy stuff was in Reality Composer. I haven't made it to the 2021 vids yet, but I'll take a look at that one next.

Add a Comment

Replies

This is unfortunately not possible: the code that generates the picture frame is part of Reality Composer itself and not RealityKit; when you export your project, the result is just a model and you cannot configure it anymore.

However, you could re-implement something similar to the picture frame by using the RealityKit APIs to create meshes and materials; the WWDC session "Explore advanced rendering with RealityKit 2" goes over creating meshes at the end.

  • Thank you very much! I appreciate how responsive you guys are on RealityKit topics. Modifying meshes was going to be my original approach until I saw how easy stuff was in Reality Composer. I haven't made it to the 2021 vids yet, but I'll take a look at that one next.

Add a Comment