this is the code in the node for everyone interested
import c4d
def main():
global result # sets a global output variable, cause the xpresso needs it :)
result = state # sets the same output to the input state
obj = doc.GetFirstObject() # this assigns the first object in the object manager to a variabale named "obj"
while obj: # while there is an object returned
if obj.GetType() == c4d.Osds: # if the object is a SDS object
obj[c4d.ID_BASEOBJECT_GENERATOR_FLAG] = state # toggle it based on the null's object enabled's state
obj = walker(obj) # keep checking all the objects in the scene.
c4d.EventAdd()
def walker(obj):
if not obj:
return
elif obj.GetDown():
return obj.GetDown()
while obj.GetUp() and not obj.GetNext():
obj = obj.GetUp()
return obj.GetNext()