How can I select all the static bodies across the tree, that have specific collision layer deifined? Is there a simple solution or do I have to recursively traverse the whole tree and check for each node?
Would it work to use groups?
I would still have to traverse the whole tree to add the nodes to the group, so the problem is still there.
How are you configuring the collision layers? Do certain entities/scenes belong to certain layers? Could you set the group for that entity type? Or are you changing the collision layers dynamically at runtime?
I'm making an addon, and I would like it to work "out of the box", so the user doesn't have to add all the nodes to a group for it to work.