Last active
August 29, 2015 14:24
-
-
Save hiroakit/b795f43f3d0d938cfb01 to your computer and use it in GitHub Desktop.
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
import maya.api.OpenMaya as om | |
def maya_useNewAPI(): | |
pass | |
class HelloWorld(om.MPxCommand): | |
kPluginCmdName = "HelloWorld" | |
def __init__(self): | |
om.MPxCommand.__init__(self) | |
@staticmethod | |
def cmdCreator(): | |
return HelloWorld() | |
def doIt(self, args): | |
print "Hello World." | |
def initializePlugin(mobject): | |
plugin = om.MFnPlugin(mobject) | |
plugin.registerCommand( | |
HelloWorld.kPluginCmdName, HelloWorld.cmdCreator | |
) | |
def uninitializePlugin(mobject): | |
pluginFn = om.MFnPlugin(mobject) | |
pluginFn.deregisterCommand(HelloWorld.kPluginCmdName) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment