On 15/12/2015 at 07:24, xxxxxxxx wrote:
Hi!
I'm completely new to plugin programming and stumble my way through the doc and examples, but I'm stuck on an error. Maybe you guys can help me out.
I'm trying to initalize description attributes from a .res file with the Init()/InitAttr() functions.
The example from the doc is:
import c4d
def Init(self, node) :
#please note, the desc element has to be a constant (id of your container element)
self.InitAttr(host=node, type=float, desc=[c4d.PY_TUBEOBJECT_RAD])
self.InitAttr(host=node, type=float, desc=[c4d.PY_TUBEOBJECT_IRADX])
node[c4d.PY_TUBEOBJECT_RAD]= 200.0
node[c4d.PY_TUBEOBJECT_IRADX] = 50.0
When I follow the syntax I get the error: _ TypeError: Required argument 'id' (pos 3) not found_
I assume, that the example is wrong and the 'desc' argument should be 'id', but I might be wrong about that.
When I change it to 'id' the attributes are set correctly, but I get the error: TypeError: Init expected bool, not None
_
_
This might be unrelated, but the Init() function also seems to be called every time I edit an attribute in the description. Is it supposed to do that?