#include
<MPxContextCommand.h>
This is the base class for context creation commands.
The purpose of this command class is to create instances of user contexts derived from MPxContext, and to allow the MEL programmer to edit and query various properties of the context related to this command.
The user will derive off of this class and override the makeObj method which will be called when this command is invoked in Maya.
The context command is registered in Maya using MFnPlugin::registerContextCommand
Public Member Functions |
|
MPxContextCommand () | |
virtual | ~MPxContextCommand () |
virtual MStatus | doEditFlags () |
virtual MStatus | doQueryFlags () |
virtual MPxContext * | makeObj () |
virtual MStatus | appendSyntax () |
MStatus | setResult (bool result) |
MStatus | setResult (int result) |
MStatus | setResult (double result) |
MStatus | setResult (const MString &result) |
Protected Member Functions |
|
MSyntax | syntax (MStatus *ReturnStatus=NULL) const |
USE _syntax() IN SCRIPT. |
|
MArgParser | parser (MStatus *ReturnStatus=NULL) const |
USE _parser() IN SCRIPT. |
MPxContextCommand::MPxContextCommand | ( | ) |
Class constructor.
MPxContextCommand::~MPxContextCommand | ( | ) | [virtual] |
Class destructor.
MStatus MPxContextCommand::doEditFlags | ( | ) | [virtual] |
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.
MStatus MPxContextCommand::doQueryFlags | ( | ) | [virtual] |
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.
MPxContext * MPxContextCommand::makeObj | ( | ) | [virtual] |
This function is used to instantiate a proxy context. In your derived class, declare this function:
MPxContext * derivedClass::makeObj() { return new userContextClass; }
where userContextClass is derived from MPxContext.
Reimplemented in MTemplateContextCommand< ContextCommandName, ContextCommandClass, ContextClass >.
MStatus MPxContextCommand::appendSyntax | ( | ) | [virtual] |
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".
MStatus MPxContextCommand::setResult | ( | bool | result | ) |
This method should be called when the result of the context command is a boolean.
[in] | result | the boolean result |
MStatus MPxContextCommand::setResult | ( | int | result | ) |
This method should be called when the result of the context command is an integer.
[in] | result | the integer result |
MStatus MPxContextCommand::setResult | ( | double | result | ) |
This method should be called when the result of the context command is a double.
[in] | result | the double result |
This method should be called when the result of the context command a string.
[in] | result | the string result |
USE _syntax() IN SCRIPT.
This method returns the syntax object of this context command. From an overridden version of the appendSyntax method you may append to the syntax object.
[out] | ReturnStatus | return status |
MArgParser MPxContextCommand::parser | ( | MStatus * | ReturnStatus =
NULL |
) | const [protected] |
USE _parser() IN SCRIPT.
This method returns the argument parser of this context command. The argument parser can be used in the overridden versions of doEditFlags and doQueryFlags to determine which flags are set.
[out] | ReturnStatus | return status |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |