Command Plug-in Basics

 
 
 

What is a Command Plug-in?

Command plug-ins define new custom MEL commands, and correspondingly add functions to the maya.cmds Python module for use in scripting. OpenMayaMPx.MPxCommand is the base class from which your custom Commands will derive. A trivial example of a command plug-in is presented in Your First Maya Python Plug-in, which creates the spHelloWorld command. This command is invoked in the Maya Script Editor in one of two ways:

Running this command prints "Hello World" to the Script Editor output. More useful commands can be defined to query the scene, and to automate the manipulation of various scene elements. Command plug-ins can also be paired with dependency graph plug-ins to facilitate the creation and connection of custom node types.