Well there is always the option to make different scenes and updating the hidden geometry with the scene manager accordingly to what you want to accomplish.
If you still want to assign a single key to toggle the visibility of nested groups then you might want to study “knightgame.rb” by Scott Lininger. In his scrip he says the following;
“# Change the visibility of the Hero components based on the current frame.”
for subentity in entity.definition.entities
if subentity.definition.name == params['frame']
subentity.hidden = false
else
subentity.hidden = true
end
end
^^^
I have no experience in scripting since I only started to learn some ruby a few days ago so I can’t be of much help but maybe someone else could make some sense on the code above.
Good luck!