Use MNodeMessage.addAttributeChangedCallback

id = OpenMaya.MNodeMessage.addAttributeChangedCallback(node, func,
clientData)


create a callback method (that you pass as to func above) like

def attributeChangedCallback(self, msg, mplug, otherMplug,
clientData):

    nodeName, attrName = mplug.name().split('.')
    if msg & OpenMaya.MNodeMessage.kAttributeRemoved:
        print 'attr %s on node %s was removed' % (attrName, nodeName)




Ryan

On 7 May, 03:26, Judah Baron <[email protected]> wrote:
> Does anyone have a good way of monitoring the deletion of a secific
> attribute? MNodeMessage.addNodePreRemovalCallback doesn't like attributes.
> It works nicely for dg/dag nodes, but gives kInvalidParameter for attribute
> mobjects.
>
> -Judah
>
> --http://groups.google.com/group/python_inside_maya

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to