Is it possible to get all views available in a scene?
The root cause is this:
Whenever you switch to a view that hides a node, all child nodes will be hidden or shown as well instead.
I’m building a configurator using the node.show() and node.hide() functions. I hide all non chosen options.
Because switching views will update the visibility of all children, all the non chosen options are shown again whenever the root node is shown.
I work around this by hiding all the non chosen options after onViewSwitchDone. However I need to know if they should be hidden depending on the view or not (there doesn’t seem to be an node.isVisible() function or variable)
There is the node.hideInViews array though which allows me to check manually if it should be visible.
Yet another issue is that it uses the ID’s while onViewSwitchDone passes the name of the current view.
Is there a way the get the views in the scene?
Or is there another way to deal with this apart from hard coding?
I do see that I could parse the scene.json for that data. Can I access that file when it’s uploaded? (seems like I can’t).
My final solution would be to write a script to retrieve the view data from the json before we upload and store it on my own server.
The ideal fix would be in shapespark itself:
Whenever you show or hide a node that is linked to a view, only update that node’s visibility and skip rendering the children if the parent node is invisible.