Created
November 6, 2019 21:47
-
-
Save RedForty/6e79911dbf42c38a4131714fb3a8850e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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