On 23/12/2015 at 05:39, xxxxxxxx wrote:
Hello,
I am new to python and plugin making since this month, so I might have overlooked something.
While working on a tooldata plugin I got confused about the InitTool function, a I always get an error in the console when reloading the python plugin, telling me the c4d.BaseContainer does not have attribute GetMode, while I was doing a doc.GetMode()
While investigating the issue I found that with following code:
def InitTool(self, doc, data, bt) :
print doc
print data
I do get two different results.
When I reload the python plugin, the console shows:
<c4d.BaseContainer object at 0x000...>
<c4d.documents.BaseDocument object called '' ....>
However, when I select the plugin I get the same but with the lines swapped
<c4d.documents.BaseDocument object called '' ....>
<c4d.BaseContainer object at 0x000...>
Since the description of InitTool mentions that basedocument is the second argument and basecontainer the third one, I can agree with the result I get when selecting the plugin.
What I don't understand is why the two arguments seem to be swapped when performing the "reload python plugins" from the menu.
So, except for the error in the console when reloading the plugin, the plugin is working correctly once selected.
Is there something I am missing ?
Thanks