In my project using THREE.js, I have successfully added meshes and CSS2DObjects (labels) to a group. When I toggle the visibility of the group, the meshes change visibility as expected. However, the CSS2DObjects' visibility does not change accordingly.
I came across a discussion thread from 2019 that provided a solution to toggle the visibility of CSS2DObject by setting its style.display property to 'none' or 'block'.
labelDiv1.style.display = 'none';
labelDiv2.style.display = 'block;
Now, I am looking for a way to retrieve a list of all CSS2DObjects within a group, whether they were directly added to the group or have hierarchical relations with meshes in the group. For each selected CSS2DObject, I need to access its associated div element.
While I could potentially create a solution for my current project, I am interested in finding a more flexible and future-proof solution to avoid reinventing the wheel. It would be ideal if such a feature was integrated into THREE.js in my opinion.