class MPxModelEditorCommand

Jump to documentation

Base class for editor creation commands (OpenMayaUI) (OpenMayaMPx.py)

public members:

MPxModelEditorCommand ()
virtual ~MPxModelEditorCommand ()
virtual MStatus doEditFlags ()
virtual MStatus doQueryFlags ()
virtual MStatus appendSyntax ()
virtual bool skipFlagForCreate (const MString &longFlag)
MStatus setResult (bool result)
MStatus setResult (int result)
MStatus setResult (double result)
MStatus setResult (const MString &result)
MStatus setResult (const MStringArray &result)
MPx3dModelView *modelView () const
virtual MString editorMenuScriptName () const

protected members:

MSyntax syntax ( MStatus *ReturnStatus = NULL) const
USE _syntax() IN SCRIPT
MArgParser parser ( MStatus *ReturnStatus = NULL) const
USE _parser() IN SCRIPT

Documentation

The base class for editor creation commands.
Description

MPxModelEditorCommand is the base class for user defined model editor commands. This command gives all of the flags and options of the modelEditor command in addition to any user defined flags or behaviours. When registering this command, use the MFnPlugin::MFnPlugin::registerModelEditorCommand() method. A MPx3dModelView is also required to be used with MPxModelEditorCommand and is specified when the MPxModelEditorCommand is registered.

Functions

MPxModelEditorCommand:: MPxModelEditorCommand ()

Description

Class constructor.

MPxModelEditorCommand:: ~MPxModelEditorCommand ()

Description

Class destructor.

MStatus MPxModelEditorCommand:: doEditFlags ()

Description

This method is called when the command is called in edit mode. This method should be overridden by panel 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.

If the command returns MS::kUnknownParameter, the flag is processed by the parent class.

Return Value

  • MS::kSuccess operation successful
  • MS::kUnknownParameter pass to the parent class
  • MS::kFailure operation failed

MStatus MPxModelEditorCommand:: doQueryFlags ()

Description

This method is called when the command is called in query mode. This method should be overridden by panel 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.

If the command returns MS::kUnknownParameter, the flag is processed by the parent class.

Return Value

  • MS::kSuccess operation successful
  • MS::kUnknownParameter pass to the parent class
  • MS::kFailure operation failed

MStatus MPxModelEditorCommand:: appendSyntax ()

Description

This method should be overridden to append syntax to the panel 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".

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

bool MPxModelEditorCommand:: skipFlagForCreate (const MString &longFlag)

Description

Returns true if the passed long flag name should be skipped during the creation portion of the command.

Arguments

  • longFlag The string containing the long flag name.

Return Value

  • Return true if the flag shoiuld be skipped during creation.

Status Codes

  • MS::kSuccess Operation successful

MStatus MPxModelEditorCommand:: setResult (bool result)

Description

This method should be called when the result of the panel command is a boolean.

Arguments

  • result the boolean result

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxModelEditorCommand:: setResult (int result)

Description

This method should be called when the result of the panel command is an integer.

Arguments

  • result the integer result

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxModelEditorCommand:: setResult (double result)

Description

This method should be called when the result of the panel command is a double.

Arguments

  • result the double result

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxModelEditorCommand:: setResult (const MString &result)

Description

This method should be called when the result of the panel command is a string.

Arguments

  • result the string result

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxModelEditorCommand:: setResult (const MStringArray &result)

Description

This method should be called when the result of the panel command is a string array.

Arguments

  • result the string result

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MSyntax MPxModelEditorCommand:: syntax ( MStatus *ReturnStatus) const

Description

This method returns the syntax object of this panel command. The syntax object can be appended to in an overridden version of the appendSyntax method.

Arguments

  • ReturnStatus return status

Return Value

  • the syntax object

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MArgParser MPxModelEditorCommand:: parser ( MStatus *ReturnStatus ) const

Description

This method returns the argument parser of this panel command. The argument parser can be used in the overridden versions of doEditFlags and doQueryFlags to determine which flags are set.

Arguments

  • Arguments

Return Value

  • the argument parser

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MString MPxModelEditorCommand:: editorMenuScriptName () const

Description

Returns the name of the script that should get executed to construct the menu for the editor. The script should take a string argument that holds the name of the created editor.

If no script is passed, the created editor will not have a menu.

Return Value

  • the name of the script

MPx3dModelView *MPxModelEditorCommand:: modelView () const

Description

Returns a pointer to the MPx3dModelView created by this command. If the MPx3dModelView was not created, NULL may be returned.

Return Value

  • pointer to the created MPx3dModelView

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright