I think I stumbled upon a bug. Consider the attached blend. It has 2 objects in a group and two instances of that group. One instance is in an inactive layer.
The code simply shows the groupmembers:
import bge
scene = bge.logic.getCurrentScene()
TestInst = scene.objects["Test"]
TestInstHidden = scene.objectsInactive["Test.Hidden"]
#print the member list
print(TestInst.groupMembers)
#should print the same but prints None
print(TestInstHidden.groupMembers)
The second print I expected to print the groupMembers as well but it always prints None.
I have a group object which contains a BoundingBox object. I wanted to set its visibility. I know I can workaround it but I thought this was a bug, just wanted to make sure it’s a bug… I’ll send a bug report
I was interested in a use case for this situation. I hope you know that changing invisibility at an inactive object does nothing. At least not at the invisible object.
I actually stumbled on the same bug, I don’t know how it is implemented but I can imagine the groupMembers to be set upon adding the group.
As for a use case; I want to add random objects from a specific group of objects. I could give all these objects a specific property and search for that or try parenting them to one object to break the parenting later on. In this case however I would find it more efficient if I just had all these objects of a specific type in one group. Both in workflow and performance.