Thank you John!
I’ve been trying to figure out your script. But I coudn’t get inObject and inLayer to show up on my python node. For anyone with the same problem: link object and layer to the python node ( which will get you Input3 and Input 4 ). Now put in this script and you should be good to go. Test by dragging something on your object with the xpresso tag.
#This script will set the layer to every
#child object to the same layer as the
#parent object (the object which contains
#the xpresso tag)
import c4d
def SetChildLayers(inObj):
for child in inObj.GetChildren():
child.SetLayerObject(Input4)
SetChildLayers(child) #recursive
def main():
SetChildLayers(Input3)