Python API 2.0 Reference
OpenMayaUI.MPxContextCommand Class Reference
+ Inheritance diagram for OpenMayaUI.MPxContextCommand:

Public Member Functions

def __init__ ()
 
def appendSyntax ()
 
def doEditFlags ()
 
def doQueryFlags ()
 
def makeObj ()
 
def parser ()
 
def setResult ()
 
def syntax ()
 

Static Public Member Functions

def __new__ ()
 

Detailed Description

Base class for custom context commands.

Constructor & Destructor Documentation

def OpenMayaUI.MPxContextCommand.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMayaUI.MPxContextCommand.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
def OpenMayaUI.MPxContextCommand.appendSyntax ( )
appendSyntax() -> None

This method should be overridden to append syntax
to the context command.  The syntax object can be
obtained by calling the syntax method.
The following flags cannot be used as user-defined
flags as they are reserved for edit and query:
'-e', '-edit', '-q', '-query'.
def OpenMayaUI.MPxContextCommand.doEditFlags ( )
doEditFlags() -> None

This method is called when the command is called in edit mode.
This method should be overridden by context commands
to determine which edit flags are set in conjunction with
the argument parser for this command.  The argument parser
for this command can be obtained by calling the
parser method.
If the command is called with both the edit flag and
the query flag, then the query flag will be ignored.
def OpenMayaUI.MPxContextCommand.doQueryFlags ( )
doQueryFlags() -> None

This method is called when the command is called in query mode.
This method should be overridden by context commands
to determine which query flags are set in conjunction with
the argument parser for this command.  The argument parser
for this command can be obtained by calling the
parser method.
If the command is called with both the edit flag and
the query flag, then the query flag will be ignored.
def OpenMayaUI.MPxContextCommand.makeObj ( )
makeObj() -> MPxContext

This function is used to instantiate a proxy context.
In your derived class, declare this function:

def makeObj(self)
    return userContextClass()

where userContextClass is derived from MPxContext.
def OpenMayaUI.MPxContextCommand.parser ( )
Returns the context command's MArgParser object, if it has one.
def OpenMayaUI.MPxContextCommand.setResult ( )
setResult() -> None

Set the value of the result to be returned by the command.  The value can be
either a boolean, integer, floating point value, or string.
def OpenMayaUI.MPxContextCommand.syntax ( )
Returns the context command's MSyntax object, if it has one.