Hey Michael, I still use the 1.0 Python API in Maya 2014 (maya.OpenMaya and not maya.api.OpenMaya since it's very limited doesn\'t have MNodeMessage etc) and it works perfectly. You should check it out with it.
On Wednesday, December 16, 2015 at 4:25:26 AM UTC+1, Michael Boon wrote: > > 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/45c0fb90-6bfa-4d89-8a47-aadc725f6c0c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
