scripted/helloWorldCmd.py
2 To use, make sure that helloWorldCmd.py is in your MAYA_PLUG_IN_PATH (and the
3 C++ version is not) then do the following:
6 maya.cmds.loadPlugin("helloWorldCmd.py")
7 maya.cmds.spHelloWorld()
11 import maya.OpenMaya
as OpenMaya
12 import maya.OpenMayaMPx
as OpenMayaMPx
15 class HelloWorldCmd(OpenMayaMPx.MPxCommand):
16 kPluginCmdName =
"spHelloWorld"
19 OpenMayaMPx.MPxCommand.__init__(self)
23 return OpenMayaMPx.asMPxPtr( HelloWorldCmd() )
25 def doIt(self,argList):
30 def initializePlugin(plugin):
31 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
33 pluginFn.registerCommand(
34 HelloWorldCmd.kPluginCmdName, HelloWorldCmd.cmdCreator
38 "Failed to register command: %s\n" % HelloWorldCmd.kPluginCmdName
43 def uninitializePlugin(plugin):
44 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
46 pluginFn.deregisterCommand(HelloWorldCmd.kPluginCmdName)
49 "Failed to unregister command: %s\n" % HelloWorldCmd.kPluginCmdName