Python API 2.0 Reference
OpenMaya.MNodeMessage Class Reference
+ Inheritance diagram for OpenMaya.MNodeMessage:

Static Public Member Functions

def addAttributeAddedOrRemovedCallback ()
 
def addAttributeChangedCallback ()
 
def addKeyableChangeOverride ()
 
def addNameChangedCallback ()
 
def addNodeAboutToDeleteCallback ()
 
def addNodeDestroyedCallback ()
 
def addNodeDirtyCallback ()
 
def addNodeDirtyPlugCallback ()
 
def addNodePreRemovalCallback ()
 
def addUuidChangedCallback ()
 
- Static Public Member Functions inherited from OpenMaya.MMessage
def currentCallbackId ()
 
def nodeCallbacks ()
 
def removeCallback ()
 
def removeCallbacks ()
 

Static Public Attributes

int kAttributeAdded = 64
 
int kAttributeArrayAdded = 4096
 
int kAttributeArrayRemoved = 8192
 
int kAttributeEval = 4
 
int kAttributeKeyable = 512
 
int kAttributeLocked = 16
 
int kAttributeRemoved = 128
 
int kAttributeRenamed = 256
 
int kAttributeSet = 8
 
int kAttributeUnkeyable = 1024
 
int kAttributeUnlocked = 32
 
int kConnectionBroken = 2
 
int kConnectionMade = 1
 
int kIncomingDirection = 2048
 
int kKeyChangeInvalid = 0
 
int kKeyChangeLast = 3
 
int kLast = 32768
 
int kMakeKeyable = 1
 
int kMakeUnkeyable = 2
 
int kOtherPlugSet = 16384
 
- Static Public Attributes inherited from OpenMaya.MMessage
int kDefaultAction = 0
 
int kDoAction = 2
 
int kDoNotDoAction = 1
 

Detailed Description

Class used to register callbacks for dependency node messages of specific dependency nodes.

The class also provides the following AttributeMessage constants which describe
the type of attribute changed/addedOrRemoved messages that has occurred:
  kConnectionMade               #a connection has been made to an attribute of this node
  kConnectionBroken     #a connection has been broken for an attribute of this node
  kAttributeEval                #an attribute of this node has been evaluated
  kAttributeSet         #an attribute value of this node has been set
  kAttributeLocked              #an attribute of this node has been locked
  kAttributeUnlocked    #an attribute of this node has been unlocked
  kAttributeAdded               #an attribute has been added to this node
  kAttributeRemoved     #an attribute has been removed from this node
  kAttributeRenamed     #an attribute of this node has been renamed
  kAttributeKeyable     #an attribute of this node has been marked keyable
  kAttributeUnkeyable   #an attribute of this node has been marked unkeyable
  kIncomingDirection    #the connection was coming into the node
  kAttributeArrayAdded  #an array attribute has been added to this node
  kAttributeArrayRemoved        #an array attribute has been removed from this node
  kOtherPlugSet         #the otherPlug data has been set


The class also provides the following KeyableChangeMsg constants which
allows user to prevent attributes from becoming (un)keyable:
  kKeyChangeInvalid
  kMakeKeyable
  kMakeUnkeyable
  kKeyChangeLast

Method resolution order:
-   MNodeMessage
-   MMessage
-   builtins.object

Member Function Documentation

def OpenMaya.MNodeMessage.addAttributeAddedOrRemovedCallback ( )
static
addAttributeAddedOrRemovedCallback(node, function, clientData=None) -> id

Registers callbacks for attribute add/removed messages.
This is a more specific version of addAttributeChanged as only attribute
added and attribute removed messages will trigger the callback.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed an AttributeMessage constant (see
   class doc for a list) containing the kind of attribute change triggering
   the callback, a MObject indicating the node's plug where the connection
   changed and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addAttributeChangedCallback ( )
static
addAttributeChangedCallback(node, function, clientData=None) -> id

This method registers a callback for attribute changed messages.
See the AttributeChanged enum for a list of all possible messages
that will trigger the callback.

Note: Attribute Changed messages will not be generated
while Maya is either in playback or scrubbing modes. If you need to
do something during playback or scrubbing you will have to register
a callback for the timeChanged message which is the only
message that is sent during those modes.

The callback function will be passed the type of attribute message
that has occurred, the plug(s) for the attributes, and any client
data that the user wishes to pass in.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed an AttributeMessage constant (see
   class doc for a list) containing the kind of attribute change triggering
   the callback, a MObject indicating the node's plug where the connection
   changed, a MObject indicating the plug opposite the node's plug where the
   connection changed and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addKeyableChangeOverride ( )
static
addKeyableChangeOverride(plug, function, clientData=None) -> id

This method registers a callback that is invoked by any class that
changes the keyable state of an attribute.  When the callback is
invoked, the API programmer can make a decision on how to handle
the given keyable change event.  The programmer can either accept
the keyable state change by returning True 
or reject it by returning False.

Note: you can only attach one callback keyable change override
callback per attribute.  It is an error to attach more than one
callback to the same attribute.

 * plug (MPlug) - The plug to which to attach the callback.
 * function - callable which will be passed a MPlug indicating the plug that
   has triggered the callback, the clientData object, and a KeyableChangeMsg
   constant (see class doc for a list) containing the kind of Keyable change
   the callback, a MObject indicating the node's plug where the connection.
   User can return True to accept the keyable state change or False to reject it.
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addNameChangedCallback ( )
static
addNameChangedCallback(node, function, clientData=None) -> id

Registers a callback for name changed messages.

 * node (MObject) - the node. If this is a NULL MObject then the callback
   applies to all node name changes.
 * function - callable which will be passed a MObject indicating the node whose
   name's changed, a string containing the previous name of the node and the
   clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addNodeAboutToDeleteCallback ( )
static
addNodeAboutToDeleteCallback(node, function, clientData=None) -> id

Registers a callback which will get called when a node is about to
be deleted.

The callback will be passed the MDGModifer that will be used to
delete the node. This modifier can be used to do any DG modifications,
such as disconnections, before the node is deleted.  These operations are
also stored and performed when the deletion operation is undone or redone.

The callback registered with this method will only get called when the
deletion operation is first performed. Undos and redos will be handled solely
through the MDGModifier which was passed to the callback on the original
deletion. If you also wish to receive notification of deletion events
when they are redone, you should register an additional callback using
addNodePreRemovalCallback().

When a node is deleted Maya automatically breaks all connections to that
node. This process takes place after the callback has been called. This
means that if you use the passed-in MDGModifier to break any
connections to the node you must be sure to call the modifier's doIt() method
before returning from the callback. Otherwise Maya will see that the connections
still exist and try to delete them again, which can lead to errors.

Note that it uses the passed-in MDGModifier to perform all the disconnections and
connections. This ensures that if the deletion is undone or redone then all of
the connections will be restored correctly.

After it is done breaking connections, the callback calls the
modifier's doIt() method to commit those disconnections. As noted
above, this is necessary to ensure that Maya doesn't see the
connections and try to break them again later on.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed a MObject indicating the node that
   will be deleted, a MDGModifier indicating the DG modifier used to delete the
   node and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addNodeDestroyedCallback ( )
static
addNodeDestroyedCallback(node, function, clientData=None) -> id

Registers a callback which will get called when a node's destructor is
called.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed the clientData object
 * clientData - User defined data that will be passed to the callback
   function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addNodeDirtyCallback ( )
static
addNodeDirtyCallback(node, function, clientData=None) -> id

Registers a callback for node dirty messages.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed a MObject indicating the node
   that has  become dirty and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addNodeDirtyPlugCallback ( )
static
addNodeDirtyPlugCallback(node, function, clientData=None) -> id

Registers a callback for node dirty messages.  This callback provides
the plug on the node that was dirtied.  Only provides dirty information
on input plugs.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed a MObject indicating the node
   that has  become dirty, a MPlug indicating the plug on the node that has
   become dirty and the clientData object * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addNodePreRemovalCallback ( )
static
addNodePreRemovalCallback(node, function, clientData=None) -> id

Registers a callback which will get called before a node is deleted.
This callback is called before connections on the node are removed.
Unlike the aboutToDelete callback, this callback will be invoked whenever
the node is deleted, even during a redo.

Pre-removal and aboutToDelete callbacks serve different purposes.  If DG
changes need to be made when a node is deleted, the aboutToDelete callback
should be used to add undoable operations to an MDGModifier to perform
these changes.  When the desired actions cannot be accomplished using the
MDGModifier passed to the aboutToDelete callback, this callback can be
used to receive notification of the deletion event, even during redo.

Note that this callback method should not perform any DG operations.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed a MObject indicating the node
   that is being deleted and the clientData object
 * clientData - User defined data that will be passed to the callback
   function

 * return: Identifier used for removing the callback.
def OpenMaya.MNodeMessage.addUuidChangedCallback ( )
static
addUuidChangedCallback(node, function, clientData=None) -> id

Registers a callback for UUID changed messages.

 * node (MObject) - the node to register the callback for
 * function - callable which will be passed a MObject indicating the node
   that is being modified, a MUuid containing the previous UUID of the node
   and the clientData object
 * clientData - User defined data that will be passed to the callback
   function

 * return: Identifier used for removing the callback.