OpenMaya.MTimerMessage Class Reference
Class used to register callbacks for timer related messages.
Method resolution order:
- MTimerMessage
- MMessage
- __builtin__.object
|
int | kDefaultAction = 0 |
|
int | kDoAction = 2 |
|
int | kDoNotDoAction = 1 |
|
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.