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

Static Public Member Functions

def addPolyComponentIdChangedCallback ()
 
def addPolyTopologyChangedCallback ()
 
- Static Public Member Functions inherited from OpenMaya.MMessage
def currentCallbackId ()
 
def nodeCallbacks ()
 
def removeCallback ()
 
def removeCallbacks ()
 

Additional Inherited Members

- Static Public Attributes inherited from OpenMaya.MMessage
int kDefaultAction = 0
 
int kDoAction = 2
 
int kDoNotDoAction = 1
 

Detailed Description

Class used to register callbacks for poly related messages.

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

Member Function Documentation

def OpenMaya.MPolyMessage.addPolyComponentIdChangedCallback ( )
static
addPolyComponentIdChangedCallback(node, (wantVertIds, wantEdgeIds, wantFaceIds), function, clientData=None) -> id

This method registers a callback that should be called whenever a poly
component id is modified.
Currently, there are some cases where the component ids for a polygonal
mesh can be modified without generating a callback or without generating a
correct mapping.  These cases are outlined below.

- Polygonal mesh has construction history enabled, and there is more than
         one topology changing operation in the history.  In this case, the
         callback is only called when the component ID mapping changes for the
         most recent operation, and performs the mapping with respect to the
         input and output meshes for this operation node.
- Polygonal mesh has construction history enabled, and the most recent
         topology changing operation is no longer the most recent operation.
         In this case, no id remapping callbacks will be invoked when the
         attributes on the operation node are changed in the history.
- When undo is used to revert a topology changing operation, the callback
         will not be invoked.  The MEventMessage class can be used to get
         notification when undo is performed.


Component id mapping should always work correctly when construction history
is off.  It should also work correctly when construction history is on and
only the most recent operation is permitted to be adjusted (eg. changing
the distance parameter for a merge vertex node, when merge vertices was the
most recent operation.)  In either case, undo will not produce a poly
message callback.

 * node (MObject) - the node the callback function should listen to
 *(wantVertIds, wantEdgeIds, wantFaceIds) - tuple of 3 booleans specifying
   what arrays should be provided to the callback function when it is
   invoked: (vertex indices, edge indices, face indices).
 * function - callable which will be passed a tuple and the clientData object.
   The tuple will contain three MUintArrays which are, respectively, the vertex,
   edge and face ids of the modified components. Only the arrays which were requested
   when the callback was registered will contain data, the others will be empty.
 * clientData - User defined data passed to the callback function

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

This method registers a callback that will be called when a node impacting
the topology of a meshShape is modified. Because the callback is invoked
before the mesh has evaluated, the new topology data cannot be
queried at the time the callback is received. If you want to receive a
callback at a time when the new mesh data can be queried, use the
following technique:

- Use this method to register a topology-changed callback.
- In the topology-changed callback, add an MNodeMessage.addAttributeChangedCallback on the mesh shape.
- In the attribute-changed callback, check the inputs for an MNodeMessage.kAttributeEval message received by the "outMesh" plug of the mesh.
- Once you have received the eval message on that plug, the attribute-changed callback can be removed and the mesh topology can be queried.

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

 * return: Identifier used for removing the callback.