I’m in the need of setting the
layer property of a Object3D and all it’s children. My issue is that children are added during the lifetime of the parent, and they are added from very different places and circumstances. Therefore I cannot simply traverse the parent to set it all when instanced. The hierarchy of parent/child relations is very deep so it won’t suffice to traverse children at instancing.
Basically what I want to do is know whenever a child has been added somewhere in the hierarchy so that I can then set the properties I need with the help of a callback. Is there any way to know this? If only knowing for a direct child added would be sufficient as well I think.
I guess a naive approach would be to traverse the children during render, but I just have a feeling the performance will take a huge hit.