I want to make various userdata elements invisible or visible. I use a Python node in Xpresso.
This code works for one case, but when I copy the python node and want to use both at the same time, only the first one works.
Anyone know what's causing this and how I can fix it?
Thank You!
import c4d
def main():
if not Object:
return
if not UserDataIDs:
return
udc = Object.GetUserDataContainer()
for descID, container in udc:
if descID.GetDepth() < 2:
continue
if container[c4d.DESC_HIDE]:
container[c4d.DESC_HIDE] = False
for n in UserDataIDs.split(','):
try:
if descID[1].id == int(n):
container[c4d.DESC_HIDE] = not Flag
break
except ValueError:
pass
Object.SetUserDataContainer(descID,container)