On 21/04/2013 at 07:34, xxxxxxxx wrote:
I'm currently trying to convert an old v8.5 coffee tag plugin to work with r14 using python. However, I'm a bit flummoxed by some peculiarities...
Especially: How do I react on changes in the tag data in the attributes manager? I created the interface as a descriptions .res file, and this part is working perfectly (and much simpler than coffee), however I would need the plugin to react when the user inputs/changes a value there. Judging from the documentation (and comparing it to coffee), overloading Message() should work:
def Message(self, node, type, data) :
if type == c4d.MSG_DESCRIPTION_COMMAND:
if data['id'][0].id==c4d.RESET_TO_ORIGIN:
print " Clicked RESET_TO_ORIGIN"
elif data['id'][0].id==c4d.UV_SET:
print " Clicked UV_SET"
elif data['id'][0].id==c4d.UV_AUTO_UPDATE:
print " Clicked UV_AUTO_UPDATE"
return True
However, I can only get a reaction from the first two - these are buttons in the .res file. The last item is a checkbox, and when I click on it, no message shows up. Same goes for real fields, links, and so on.
I tried both MSG_DESCRIPTION_VALIDATE and MSG_DESCRIPTION_POSTSETPARAMETER, and while those react to the entries in elements other than buttons, however I can't get information on which element sent the message, since the data parameter returns None.
Is there a way to get the id of the calling description element other than buttons, or is this not possible in python?
thanks,
Mike