20 import maya.OpenMaya
as OpenMaya
21 import maya.OpenMayaMPx
as OpenMayaMPx
24 class HelloWorldCmd(OpenMayaMPx.MPxCommand):
25 kPluginCmdName =
"spHelloWorld"
28 OpenMayaMPx.MPxCommand.__init__(self)
32 return OpenMayaMPx.asMPxPtr( HelloWorldCmd() )
34 def doIt(self, argList):
39 def initializePlugin(plugin):
40 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
42 pluginFn.registerCommand(
43 HelloWorldCmd.kPluginCmdName, HelloWorldCmd.cmdCreator
47 "Failed to register command: %s\n" % HelloWorldCmd.kPluginCmdName
52 def uninitializePlugin(plugin):
53 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
55 pluginFn.deregisterCommand(HelloWorldCmd.kPluginCmdName)
58 "Failed to unregister command: %s\n" % HelloWorldCmd.kPluginCmdName