On 27/11/2013 at 04:36, xxxxxxxx wrote:
Hello,
I am trying to find out how to disable userdata (to grey the field out/disable it)
I was able to find a script that hides userdata
import c4d
from c4d import gui
def main() :
obj=op.GetObject()
UD = obj.GetUserDataContainer()
for descId, container in UD:
if descId[1].id == 1:
if obj[c4d.ID_USERDATA,2] == 0:
container[c4d.DESC_HIDE] = True
obj.SetUserDataContainer(descId, container)
if obj[c4d.ID_USERDATA,2] != 0:
container[c4d.DESC_HIDE] = False
obj.SetUserDataContainer(descId, container)
I tried replacing DESC_HIDE with DESC_EDITABLE to disable the userdata, but that doesn't seems to work
Any help can be offered ?!
Thanks,