OpenMaya.MLockMessage Class Reference

OpenMaya.MLockMessage Class Reference

Class Description

Class used to register callbacks for model related messages.

Method resolution order:
-   MLockMessage
-   MMessage
-   __builtin__.object
+ Inheritance diagram for OpenMaya.MLockMessage:

Static Public Member Functions

setNodeLockDAGQueryCallback ()
 
setNodeLockQueryCallback ()
 
setPlugLockQueryCallback ()
 
- Static Public Member Functions inherited from OpenMaya.MMessage
currentCallbackId ()
 
nodeCallbacks ()
 
removeCallback ()
 
removeCallbacks ()
 

Static Public Attributes

int kAddAttr = 5
 
int kChildReorder = 4
 
int kCreateChildInstance = 6
 
int kCreateNodeInstance = 5
 
int kCreateParentInstance = 7
 
int kDelete = 2
 
int kGroup = 1
 
int kInvalid = 0
 
int kInvalidDAG = 0
 
int kInvalidPlug = 0
 
int kLast = 10
 
int kLastDAG = 8
 
int kLastPlug = 8
 
int kLockAttr = 9
 
int kLockNode = 3
 
int kPlugAttrValChange = 3
 
int kPlugConnect = 6
 
int kPlugDisconnect = 7
 
int kPlugLockAttr = 1
 
int kPlugRemoveAttr = 4
 
int kPlugRenameAttr = 5
 
int kPlugUnlockAttr = 2
 
int kRemoveAttr = 6
 
int kRename = 1
 
int kRenameAttr = 7
 
int kReparent = 3
 
int kUnGroup = 2
 
int kUnlockAttr = 8
 
int kUnlockNode = 4
 
- Static Public Attributes inherited from OpenMaya.MMessage
int kDefaultAction = 0
 
int kDoAction = 2
 
int kDoNotDoAction = 1
 

Member Function Documentation

OpenMaya.MLockMessage.setNodeLockDAGQueryCallback ( )
static
setNodeLockDAGQueryCallback(dagPath, function, clientData=None) -> id

This methods registers a callback that is invoked in any situation
involving a locking condition on DAG level changes.  When called,
the API user can make a decision on how to handle the given locking
situation. The programmer can either accept the default action, or
they can deny the default action. The decision is returned through a
decision variable which is passed to the callback function.

The callback function takes the following parameters:
 * dagPath - The DAG path that the event occurred on.
 * otherPath - The other path involved, e.g. the new parent.
 * clientData - User defined data passed to the callback function.
 * eventType - Description of the event.
And return True to accept the default behavior and False to 
reject it.

 The meanings of the dagPath and otherPath parameters for each
eventType, and default actions associated with those event types, are
as follows:

kGroup
 * dagPath - Path of the node to be grouped.
 * otherPath - Path of the group node.
 * default actions - If dagPath
   is locked then the default action is to not allow the grouping.
   If dagPath is unlocked then dagPath
   can be grouped with otherPath.

kUnGroup
 * dagPath - Path of the node attempted to ungroup.
 * otherPath - Path of the group node.
 * default actions - If dagPath is locked then
   the default action is to not allow the ungrouping. If dagPath
   is unlocked then dagPath can be ungrouped from otherPath.

kReparent
 * dagPath - Path of the node which is being reparented.
 * otherPath - Path of the new parent, if any. When
   reparenting to the world, otherPath will be invalid.
 * default actions - If dagPath is locked then
   the default action is to not allow the reparenting. If dagPath
   is unlocked then dagPath can be parented to otherPath.

kChildReorder
 * dagPath - Path of the child node to be reordered.
 * otherPath - Path of the parent node.
 * default actions - If dagPath is locked then
   the default action is to not allow the reordering. If dagPath
   is unlocked then dagPath can be reordered on otherPath.

kCreateNodeInstance
 * dagPath - Path of the node which is being instanced.
 * otherPath - Invalid Path.
 * default actions - If dagPath is locked then
   the default action is to not allow the instance to be created.
   If dagPath is unlocked then dagPath can be instanced.

kCreateChildInstance
 * dagPath - Path of the node whose child is being
   instanced.
 * otherPath - Path of the child node.
 * default actions - If dagPath is locked then
   the default action is to not allow the instance to be created.
   If dagPath is unlocked then dagPath can be instanced.

 * dagPath (MDagPath) - The path to attach the callback.
 * function - the callback function (see below for the description)
 * clientData - User defined data passed to the callback function

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

This methods registers a callback that is invoked in any locking
condition on node properties, e.g. name, lock status, etc. When
called, the API user can make a decision on how to handle the given
locking situation. The programmer can either accept the default
action, or they can deny the default action. The decision is returned
through a decision variable which is passed to the callback function.

The callback function takes the following parameters:
   * node - The node that triggered the callback.
   * aux - Any auxiliary data that may be needed, e.g.
     the attribute about to be added.
   * clientData - User defined data passed to the
     callback function.
   * eventType - Description of the event.
And return True to accept the default behavior and False to 
reject it.

The meanings of the node and aux parameters for each
eventType, and default actions associated with those event types, are
as follows:

kRename
   * node - The node that the user is attempting to rename.
   * aux - MObject.kNullObj
   * default actions - If node is locked then the
     default action is to not allow the rename. Otherwise,
     if node is unlocked then node can be renamed.

kDelete   * node - The node that the user is attempting to delete.
   * aux - MObject.kNullObj
   * default actions - If node is locked then the
     default action is to not allow the delete. If node is unlocked
     then the node can be deleted.

kLockNode   * node - The node that the user is attempting to lock.
   * aux - MObject.kNullObj
   * default actions - If node is unlocked then the
     default action is to ALLOW the node to be locked. The callback
     is not invoked when the user tries to unlock an already unlocked
     node.

kUnlockNode   * node - The node that the user is attempting to unlock.
   * aux - MObject.kNullObj
   * default actions - If node is locked then the
     default action is to ALLOW the unlock. The callback is not invoked
     when the user tries to unlock an already unlocked node.

kAddAttr   * node - The node that is having an attribute added.
   * aux - MObject of the attribute to be added. Note:
     the attribute does not belong to the node yet. You can only
     access the attribute information using MFnAttribute.
   * default actions - If node is locked then the default
     action is to not allow to the addition of aux. If node
     is unlocked then aux can be added to the node.

kRemoveAttr
   * node - The node that is having an attribute removed.
   * aux - The attribute to be removed. In certain
     situations the user is allowed to do a global delete,
     e.g. "deleteAttr -at AttrName [nodes]". In these cases the plug is not
     created until checks have been performed; so aux ==
     MObject.kNullObj
   * default actions - If node is locked then the default
     action is to not allow the attribute removal. If node is
     unlocked then aux can be removed.

kRenameAttr
   * node - The node that is having an attribute renamed.
   * aux - The attribute.
   * default actions - If node is locked then the default
     action is to not allow the rename. If node is unlocked then
     aux can be renamed.

kUnlockAttr
   * node - The node that is having an attribute unlocked.
   * aux - The attribute to be unlocked.
   * default actions - If node is locked then the default
     action is to not allow the unlock. If node is unlocked then
     aux attribute can be unlocked.

kLockAttr
   * node - The node that is having an attribute locked.
   * aux - The attribute to be locked.
   * default actions - If node is locked then the default 
     action is to not allow the locking of aux. If node is 
     unlocked then aux can be locked.

 * node (MObject) - The node to register the callback for.
 * function - the callback function (see below for description)
 * clientData - User defined data passed to the callback function

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

This method registers a callback that is invoked in any locking
condition on a plug, e.g. plug unlock, plug lock, connections, etc.
When the callback is invoked, the API programmer can make a decision on
how to handle the given locking situation. The programmer can either
accept the default action, or they can deny the default action.
The decision is made through the decision variable described above.

The callback function takes the following parameters:
   * plug - The plug that triggered the callback.
   * otherPlug - The other plug involved in the callback.
     This is only valid during connect and disconnect events.
     clientData - User defined data passed to the
     callback function.
   * eventType - Description of the event.
And return True to accept the default behavior and False to
reject it.

The meanings of the plug and otherPlug parameters for each
eventType, and default actions associated with those event types, are
as follows:

kPlugLockAttr
   * plug - The plug that the user is attempting to lock.
   * otherPlug - None.
   * default actions - If plug is unlocked then the
     default action is to allow the plug to be locked.

kPlugUnlockAttr
   * plug - The plug that the user is attempting to unlock.
   * otherPlug - None.
   * default actions - If plug is locked then the
     default action is to allow the plug to be unlocked.

kPlugAttrValChange
   * plug - The plug that the user is attempting to change.
   * otherPlug - None.
   * default actions - If plug is locked then the
     default action is to not allow plug to change. If plug is
     unlocked then plug can change.

kPlugRemoveAttr
   * plug - The plug that the user is attempting to remove.
   * otherPlug - None.
   * default actions - If plug is locked then the
     default action is to not allow removal. Otherwise, if plug is
     unlocked then plug can be removed.

kPlugRenameAttr
   * plug - The plug that the user is attempting to rename.
   * otherPlug - None.
   * default actions - If plug is locked then the default
     action is to not allow the rename. Otherwise, if plug is
     unlocked then plug can be renamed.

kPlugConnect
   * plug - The plug that is to be connected (incoming
     connection).
   * otherPlug - The source plug of the connection being made.
   * default actions - If plug is locked then the
     connection is DENIED. If plug is unlocked then otherPlug can
     be connected to plug.

kPlugDisconnect
   * plug - The plug that it is having an incoming connection broken.
   * otherPlug - The source plug of the connection being made.
   * default actions - If plug is locked then the
     default action is to DENY the connection from being broken. If
     plug is unlocked then otherPlug can be disconnected from
     plug.

 * plug (MPlug) - the plug to attach the callback
 * function - the callback function (see below for description)
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.