"Very appreciate your feedback. I’ve made some attempts based on your suggestions, and I’ve encountered a few issues. Before I elaborate on these, let me first describe the effect I am trying to achieve: I have an array [a, b, c, d, e], each element corresponding to a different object. If I want to hide ‘a’, I can do so by calling hideObjects([a.objectid])
. Then, for the reverse operation, which is to hide all objects except ‘a’, I use the code hideObjects([b.objectid, c.objectid, d.objectid, e.objectid]), showObject([a.objectid])
. This is essentially the exact opposite of just hiding object ‘a’. However, in practice, when my model is too large, I need to pass in a very large number of ‘ids’, which is why I mentioned the issue of handling 16,000 ‘ids’ earlier. I also tried using just one root id, but then I found that I couldn’t display any components, so this method was not feasible for me.
Regarding the performance issue I mentioned earlier, I noticed that the demo you gave me was executed directly using JavaScript, but in my case, I am monitoring an array of ‘hideobjects’ through the ‘watch’ API in ‘FE2’, which is based on ‘Vue3’. I am not clear on the differences between these two methods, but they seem to affect the execution efficiency of ‘hideobjects’.
Moreover, when I set aside the performance issues, the result of my above-mentioned reverse operation also has a problem. Taking [a, b, c, d, e] as an example, in some cases when I call hideObjects([b.objectid, c.objectid, d.objectid, e.objectid]), showObject([a.objectid])
, the ‘a’ component should be visible, but it isn’t. This issue occurs in the following model:
model0
I’ve observed that when I execute ‘hideobject’ on this model, using hideObjects('09ed976ef5fd5f33bdd2b64eae3fa3e7')
results in a large number of components being hidden, which is not what I intended. The model link is as follows:model1
You can request access from me, and I will respond as soon as possible.
Additionally, I’ve always been wondering why the underlying mechanism of the ‘hideObjects’ function is to replace materials instead of using visible=false
in Three.js or setting an invisible ‘layers’. Wouldn’t these alternatives be significantly more efficient in terms of performance than replacing materials?"