I am working on an experience with the HoloLens and would like to know if anyone has had any luck hiding models?
I have a model broken down into stations and would like to be able to turn those on and off on demand.
I got there, sort of but didn't really like how I did it. I used multiple views and loaded multiple models that had a sequence where I could stage and reset as needed. that caused a lot of unnecessary reloading of the models.
My second attempt was to load the models once but then toggle them off, but I can't seem to get that to work with the Hololens. The preview works fine but not in the actual experience. I saw some others that had similar issues but I couldn't really follow if they solved the issue or not.
Any guidance with this would be greatly appreciated.
If your models don't have sequences, then you should just be able to use JS to change the visible property between true and false.
If your models are using animation sequences, then you'll have problems with turning things on and off as there is a bit of a conflict between the visibility defined for the widget vs. the visibility defined in the sequence. If you're trying to turn off model that is using a sequence, then the consistent way that I've found to make this work is to use an application parameter bound to the opacity of the model widget and then change the value from 1 to 0. See here for details: ForceHidden issues on HoloLens
From my testing, using visible or forcehidden had no effect. Only using an application parameter to change the opacity works. So if I have a model with a model that is set to visible and has a sequence defined, I do this:
Note that this will not work in the preview, but it does work on the HoloLens.
Hope this helps.
One of the ways to hide the 3D Model is as follows:
In this example, I have considered two 3D Models:
When viewing in HoloLens, every double tap action can switch between the models. Hope this helps!