How can I access Model3D entity to set shader material effects

I am using Model3D to display an RCP scene/model in my UI.

How can I get to the entities so I can set material properties to adjust the appearance?

I looked at interfaces for Model3D and ResolvedModel3D and could not find a way to get access to the RCP scene or RealityKit entity.

Answered by richoncode in 802154022

I did find a solution for this. I generated my USD code including my shadergraph. I then use that USD text to load my Model3D. It works pretty well and I now have scrollable list of stereo images that looks really good on Vision Pro.

@richoncode

There's no supported way for you to access the entity from a Model3D with the APIs currently available. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?.

That said and as you alluded to, you can use a RealityView with a ModelEntity, but you will lose some of the functionality of Model3D. For example you can't use ResolvedModel3D resizable(_:), but you can achieve a similar effect using a RealityView and GeometryReader3D. If you have a specific use case and can't find a way to achieve it, create a new post with the question, reply with the link and I'll help you.

Accepted Answer

I did find a solution for this. I generated my USD code including my shadergraph. I then use that USD text to load my Model3D. It works pretty well and I now have scrollable list of stereo images that looks really good on Vision Pro.

How can I access Model3D entity to set shader material effects
 
 
Q