In my code, there is a function that runs through my scene in search of a specific node. When it finds this node, it goes through its children and checks if any of them have properties like geometry or material. If they do, I use the dispose()
method to remove those children.
Now, before calling dispose()
, I want to compare the geometry.id of the child with the geometry ids of other children in the scene. If there is a match, then instead of disposing it, I just remove
it. However, if there are no matching geometry ids, then I proceed to call dispose()
and remove
the child.