selected_measurement_Style_url is the variable will be changing when user selects a new blouse style. I am getting a overlap issue. The new model is loading on top of previous model For example blouse [Top garment ] @brianzinn
Thank you .
hi @Chaitanya_Yanamala
I haven’t seen the <Model ../> component used that way before. One way would be to key off the sceneFilename. That will force the previous model to be disposed:
Another perhaps more intuitive approach is to move those into the useEffect dependency array in the <Model ../> component, which matches the <Suspense ..>... cache.
You can see that the Model component is a lightweight Functional Component wrapping the useSceneLoader hook. I wouldn’t necessarily want to necessarily dispose() the model without at least a minor bump to add those props as dependencies.
You don’t need to reload the scene - just change the file name and it will dispose the old and load the new automatically. I’ll make some time for a code sandbox hopefully on Sunday - there’s another similar question being asked that needs same answer.
There are some recipes that hide the model and reload it if needed by just showing again, but they rely on the useSceneLoader hook and are better for a finite list of models.