THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/07/2012 at 23:24, xxxxxxxx wrote:
Hi everybody,
I'm asking me which elements from lib_description.h are implemented in python at the moment.
In this forum there's a lot stuff dealing with hide/disable datafields, and it's a little confusing me.
After looking for a method to disable some fields of my tag-plugin I found an example that shows how to hide single userdata-fields. And it works great.
import c4d
from c4d import documents
def main() :
doc = documents.GetActiveDocument()
obj = doc.SearchObject("Null")
#v1 = obj[c4d.ID_USERDATA,1]
#v2 = obj[c4d.ID_USERDATA,2]
allUserdatas = obj.GetUserDataContainer()
for descId, container in allUserdatas:
id = descId[1].id
if id == 2:
container[15] = False
obj.SetUserDataContainer(descId, container)
The id 15 = DESC_HIDE and it works as expected. But when I try to use DESC_EDITABLE (to grey the field out/disable it) by using the id 26 nothing happens.
I guess not all id's are implemented yet?
And does anybody know a method how to access not only the userdata?
I've tried the same with GetDataInstance() but as expected it doesn't work.
import c4d
from c4d import documents
def main() :
doc = documents.GetActiveDocument()
obj = doc.SearchObject("Scheibe")
allData = obj.GetDataInstance()
for descId, container in allData:
id = descId[1].id #doesn't work, cause int is unsubscriptable
if descId == 1161:
container[15] = True #doesn't work, cause float does not support item assignment
Does anybody has an idea?
Cheers,
Sven