|
Heyoo! We’re familiarizing ourselves with the maya api and stumbled upon registering custom callbacks.
We are using the addPolyComponentIdChangedCallback to catch polygon updates (guessing it is what the callback is for..) like this:
def cbFunction(a,b,c):
... # node : MObject MPolyMessage.addPolyComponentIdChangedCallback(node,[True,False,False],3,cbFunction)
This yields this error:
// Error: in method 'MPolyMessage_addPolyComponentIdChangedCallback', argument 2 of type 'bool []'
# Traceback (most recent call last):
# File "<maya console>", line 33, in newNodeCB
# TypeError: in method 'MPolyMessage_addPolyComponentIdChangedCallback', argument 2 of type 'bool []' //
// Warning: Failed to call script callback //
We’ve tried using ctypes instead of a standard array, but we still get the same error.
Also, according to the python docs, the function only needs three arguments: node, wantIdModifications and callback function. Using it this way generates the following error:
// Error: MPolyMessage_addPolyComponentIdChangedCallback() takes at least 4 arguments (3 given)
# Traceback (most recent call last):
# File "<maya console>", line 33, in newNodeCB
# TypeError: MPolyMessage_addPolyComponentIdChangedCallback() takes at least 4 arguments (3 given) //
// Warning: Failed to call script callback //
We’re using Autodesk Maya 2012, any help would be much appreciated!
|