Skip to content

Instantly share code, notes, and snippets.

@hiroakit
Last active August 29, 2015 14:24
Show Gist options
  • Save hiroakit/b795f43f3d0d938cfb01 to your computer and use it in GitHub Desktop.
Save hiroakit/b795f43f3d0d938cfb01 to your computer and use it in GitHub Desktop.
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