AREA forums upgrade
Read more about the planned upgrade of our forums
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / addPolyComponentIdChangedCallback in Maya 2012
IMPORTANT ANNOUNCEMENT ABOUT AREA FORUMS
  RSS 2.0 ATOM  

addPolyComponentIdChangedCallback in Maya 2012
Rate this thread
 
67091
 
Permlink of this thread  
avatar
  • Total Posts: 1
  • Joined: 15 May 2012 05:34 AM

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!



Replies: 0