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

Static Public Member Functions

def addTimerCallback ()
 
- 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 timer related messages.

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

Member Function Documentation

def OpenMaya.MTimerMessage.addTimerCallback ( )
static
addTimerCallback(period, function, clientData=None) -> id

This method registers a callback which is called repeatedly with a
specified period of time between calls. Each time the timer fires the
callback will be placed on the idle queue for execution in the next
idle cycle. If the timer fires again, before the previous invocation
has completed execution, the new firing will be skipped.

If the execution time of the callback exceeds half of its period then
the next timeout will be skipped to give Maya time to process other tasks.

The maximum resolution for this callback is about 1ms.  The response
is, however, not guaranteed because while multitasking, the OS may
delay for an unspecified length of time before returning control to
Maya.

 * period (float) - the period at which the callback will be
executed (Measured in seconds)
 * function - callable which will be passed a float indicating
   the elapsed time since this function was last called, a float
   indicating the execution time of this function the last time
   it was called, and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.