class MSimple

Jump to documentation

: public MPxCommand (OpenMaya)

Inheritance:

MSimple < MPxCommand


Inherited from MPxCommand:

public members:

virtual MStatus doIt ( const MArgList & args )
virtual MStatus undoIt ( )
virtual MStatus redoIt ( )
virtual bool isUndoable () const
virtual bool hasSyntax () const
MSyntax syntax () const
bool isHistoryOn () const
MString commandString () const
MStatus setHistoryOn ( bool state )
MStatus setCommandString ( const MString & )
static void displayInfo ( const MString & theInfo )
static void displayWarning ( const MString & theWarning )
static void displayError ( const MString & theError )
static void displayWarning ( const MString & theWarning, bool wantDisplayLineNumber )
static void displayError ( const MString & theError, bool wantDisplayLineNumber )
enum MResultType
kLong
kDouble
kString
kNoArg
static void clearResult ()
static void setResult ( int val )
static void setResult ( double val )
static void setResult ( bool val )
static void setResult ( const char* val )
static void setResult ( const MString & val )
static void setResult ( const MIntArray & val )
static void setResult ( const MDoubleArray & val )
static void setResult ( const MStringArray & val )
static void appendToResult ( int val )
static void appendToResult ( double val )
static void appendToResult ( bool val )
static void appendToResult ( const char* val )
static void appendToResult ( const MString & val )
static void appendToResult ( const MStringArray & val )
static MResultType currentResultType ()
static MStatus getCurrentResult ( int& val )
static MStatus getCurrentResult ( double& val )
static MStatus getCurrentResult ( MString & val )
static MStatus getCurrentResult ( MIntArray & val )
static MStatus getCurrentResult ( MDoubleArray & val )
static MStatus getCurrentResult ( MStringArray & val )
static int currentIntResult ( MStatus * ReturnStatus = NULL )
static double currentDoubleResult ( MStatus * ReturnStatus = NULL )
static MString currentStringResult ( MStatus * ReturnStatus = NULL )
MStatus setUndoable ( bool state )

Documentation

This header contains two macros that can be used to simplify the creation of plug-in commands.

DeclareSimpleCommand( className, vendorName, version ) To use this macro, you provide it with the name of the class that should be derived from MPxCommand, the name of your organisation, and the version number of the plug-in. The macro expands to all the code necessary to create a command except for the command's "doIt" method. You need to provide a function with the prototype

MStatus className::doIt( const MArgList& )

The macro will generate a class with the given classname that is derived from MPxCommand. It will also generate the following methods:

void* className::creator()

MStatus initializePlugin( MObject )

MStatus uninitializePlugin( MObject )

You can also call methods inherited from MPxCommand such as "setResult", "displayWarning", and "displayError".

DeclareSingle( functionPtr ) To use this macro you must write a function with the prototype: MStatus functionPtr ( const MArgList& )

The macro expands to all the code necessary to create a basic non-undoable command that calls "functionPtr" from it's doIt method. One limitation of using this macro is that since "functionPtr" is not a member of the class derived from MPxCommand, it cannot call methods (like setResult) that are inherited from that class.

The macro will generate a class called _DoItCmd which is derived from MPxCommand. It also generate the following methods:

void* _DoItCmd::creator()

MStatus _DoItCmd::doIt( const MArgList& args )

MStatus initializePlugin( MObject )

MStatus uninitializePlugin( MObject )

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright