Created
October 30, 2014 00:05
-
-
Save whoiscarlo/e56279f164ce66005f13 to your computer and use it in GitHub Desktop.
Maya Python Callback
This file contains 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
class Callback(object): | |
def __init__(self, func, *args, **kwargs): | |
self.func = func | |
self.args = args | |
self.kwargs = kwargs | |
def __call__(self, *args): | |
return self.func( *self.args, **self.kwargs ) | |
and this to call it | |
mc.menuItem(l='Remove set from scene', c=Callback(self.stripObject, obj, member, 1, selButton)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment