THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/12/2010 at 08:16, xxxxxxxx wrote:
Cinema 4D Version: 12
Language(s) : PYTHON ;
just a simple question: how can I access an object attribute in Python? In Coffee it was something like object#ATTRIBUTE_ID, with the id automatically written by a drag and drop from the attribute's field. Is there something similar in Python?
On 14/12/2010 at 08:25, xxxxxxxx wrote:
You can also drag&drop the attribute in to the python-console.
To access an example: obj[c4d.PRIM_CUBE_SUBX]=10
On 14/12/2010 at 08:58, xxxxxxxx wrote:
Thank you for your answer.
In fact my problem was more general, because in Coffee the variable "op" is a reference to the object the Coffee tag is applied, whereas in Python - as I just discovered - op is a reference to the tag itself, so I had to write something like:
obj = op.GetObject()
obj[c4d.ATTRIBUTE_ID] = 10
and that way it works