Skip to content

Instantly share code, notes, and snippets.

@RedForty
Created November 6, 2019 21:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RedForty/6e79911dbf42c38a4131714fb3a8850e to your computer and use it in GitHub Desktop.
Save RedForty/6e79911dbf42c38a4131714fb3a8850e to your computer and use it in GitHub Desktop.
import maya.api.OpenMaya as api
from functools import partial
def reportCallbackEventNames(c, *args):
print c
# install
cbs = api.MEventMessage.getEventNames()
installed_cbs = []
for c in cbs:
if c not in ['idleHigh', 'idle', 'idleVeryLow']:
cb = api.MEventMessage.addEventCallback(c, partial(reportCallbackEventNames, c))
installed_cbs.append(cb)
# uninstall
for c in installed_cbs:
api.MMessage.removeCallback(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment