Model visibility toggle problems

Hello,

I’m experiencing issues with toggling the visibility of my models in my app. The current workflow of the app is:

  • Loading static models
  • Loading user-custom models

The problem arises when I try to toggle the visibility of some models. When using setNodesVisibility or isolateNodes, it ends up hiding all models in the scene, not just the ones I want to target.

As a workaround, I’m using setNodesOpacity() to hide or show the nodes I need, and it works as expected, this confirms that I’m not incorrectly targeting the nodes since everything functions properly when using opacity instead of visibility. However, the downside of this approach is that the parts remain selectable, which is not desired.

I don’t understand why setting opacity on an array of nodes works, but setting the visibility of the same array does not. I am using HOOPS 2024.5.0, and all my models were converted using the same version.

Hello @theo,

Welcome to the forum !

For both functions you mentioned (setNodesVisibility and setNodesOpacity), child nodes inherit the visibility and opacity attributes from the parent node. So it’s not clear to us why you are getting different results between the functions when passing the same targeted nodes. We would expect the results to be the same.

Worth mentioning is that setNodesVisibility has an optional argument called initiallyHiddenStayHidden which could be affecting the result.

It would probably be best if you created a support ticket in our Support Portal. We will need reproduction steps using your code as well as the model file in question to do a more thorough evaluation.

Thanks,
Tino