Hi all,

If I add a callback to a node like this:
import maya.api.OpenMaya as om
mayaCallbackID = om.MNodeMessage.addAttributeChangedCallback(mObj, myFunc)

and then later I do
om.MMessage.removeCallback(mayaCallbackID)

I get the error
#RuntimeError: (kInvalidParameter): No element at given index 

If I look at the callbacks on the node like this:
print om.MMessage.nodeCallbacks(mObj)

I can see that mayaCallbackID is among the IDs on the node.
I see examples of MNodeMessage being removed like this in the API examples, 
eg 
http://help.autodesk.com/view/MAYAUL/2015/ENU/?guid=__cpp_ref_hw_unlit_shader_2_node_monitor_8cpp_example_html

but it doesn't seem to work in Python. Has anyone done this successfully? 
What am I doing wrong?

Thanks,

Boon

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/94af09c3-892e-4597-aecc-132634e1461f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to