On 14/10/2016 at 03:39, xxxxxxxx wrote:
Hi All,
I am really struggling with the following. I tried some different versions but the all seem to give the same result:
Code:
class SETLIGHT(plugins.ObjectData) :
def __init__(self) :
self.SetOptimizeCache(False)
def Message(self, node, type, data) :
data = node.GetDataInstance()
if type==c4d.MSG_DESCRIPTION_COMMAND:
if data['id'][0].id==THE_BUTTON_ID:
print "Pushed button with command ID", THE_BUTTON_ID
return True
if __name__ == "__main__":
path, file = os.path.split(__file__)
bmp = bitmaps.BaseBitmap()
bmp.InitWith(os.path.join(path, "res", "Setlight.png"))
plugins.RegisterObjectPlugin(id=PLUGIN_ID, str="Lights Controller",
g=SETLIGHT,
description="Setlight", icon=bmp,
info=c4d.OBJECT_GENERATOR)
Somehow I get the same error in my console:
Traceback(most recent call last) :
TypeError:__getitem__ expected int, not str
Can somebody help me and tell me what I'm doing wrong,
The code above comes form the maxons own sdk manual...