C++ API Reference
MPxPolyTweakUVInteractiveCommand Class Reference

Base class used for moving polygon UV's. More...

#include <MPxPolyTweakUVInteractiveCommand.h>

+ Inheritance diagram for MPxPolyTweakUVInteractiveCommand:

Public Member Functions

 MPxPolyTweakUVInteractiveCommand ()
 Class constructor.
 
 ~MPxPolyTweakUVInteractiveCommand () override
 Class destructor.
 
void setUVs (const MObject &mesh, MIntArray &uvList, MFloatArray &uPos, MFloatArray &vPos, const MString *uvSet=NULL)
 This method sets the uv to new values. More...
 
bool isUndoable () const override
 This method is used to specify whether or not the command is undoable. More...
 
MStatus doIt (const MArgList &args) override
 This method should perform a command by setting up internal class data and then calling the redoIt method. More...
 
MStatus cancel () override
 This method cancels the command. More...
 
MStatus finalize () override
 This method finishs the editing of uv. More...
 
- Public Member Functions inherited from MPxToolCommand
 MPxToolCommand ()
 Class constructor. More...
 
 ~MPxToolCommand () override
 Class Destructor. More...
 
- Public Member Functions inherited from MPxCommand
 MPxCommand ()
 Constructor.
 
virtual ~MPxCommand ()
 Destructor. More...
 
virtual MStatus undoIt ()
 This method should undo the work done by the redoIt method based on the internal class data only. More...
 
virtual MStatus redoIt ()
 This method should do the actual work of the command based on the internal class data only. More...
 
virtual bool hasSyntax () const
 This method specifies whether or not the command has a syntax object. More...
 
MSyntax syntax () const
 This method is intended to be used in an MArgDataBase or MArgParser contructor when the plugin command's syntax is being initialized. More...
 
bool isHistoryOn () const
 Returns whether history is on. More...
 
MString commandString () const
 This method returns the command string that is associated with this command. More...
 
MStatus setHistoryOn (bool state)
 This method specifies if history for this command is on. More...
 
MStatus setCommandString (const MString &)
 Sets the command string that is associated with this command object. More...
 
MStatus setUndoable (bool state)
 This method is obsolete. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MPxToolCommand
static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MPxCommand
static void displayInfo (const MString &theInfo)
 This method is used to display information in the script editor. More...
 
static void displayWarning (const MString &theWarning, bool showLineNumber=false)
 This method is used to display a warning in the script editor. More...
 
static void displayError (const MString &theError, bool showLineNumber=false)
 This method is used to display an error in the script editor. More...
 
static void clearResult ()
 Initializes the place where results from Maya commands get stored.
 
static void setResult (unsigned int val)
 This method puts the given value into the return value area for a command. More...
 
static void setResult (int val)
 This method puts the given value into the return value area for a command. More...
 
static void setResult (double val)
 This method puts the given value into the return value area for a command. More...
 
static void setResult (bool val)
 This method puts the given value into the return value area for a command. More...
 
static void setResult (const char *val)
 This method puts the given value into the return value area for a command. More...
 
static void setResult (const MString &val)
 This method puts the given value into the return value area for a command. More...
 
static void setResult (const MIntArray &val)
 This method puts the given values into the return value area for a command. More...
 
static void setResult (const MDoubleArray &val)
 This method puts the given values into the return value area for a command. More...
 
static void setResult (const MStringArray &val)
 This method puts the given values into the return value area for a command. More...
 
static void appendToResult (int val)
 This method will add the given value to the end of the result array of integers. More...
 
static void appendToResult (double val)
 This method will add the given value to the end of the result array of doubles. More...
 
static void appendToResult (bool val)
 This method will add the given value to the end of the result array of integers. More...
 
static void appendToResult (const char *val)
 This method will add the given value to the end of the result array of strings. More...
 
static void appendToResult (const MString &val)
 This method will add the given value to the end of the result array of strings. More...
 
static void appendToResult (const MStringArray &val)
 This method will add the given value to the end of the result array of strings. More...
 
static bool isCurrentResultArray ()
 This method will return whether the return result for the command is an array or not. More...
 
static MResultType currentResultType ()
 This method will return the type of the current result for the command. More...
 
static MStatus getCurrentResult (int &val)
 This method is not available in Python. More...
 
static MStatus getCurrentResult (double &val)
 This method is not available in Python. More...
 
static MStatus getCurrentResult (MString &val)
 This method is not available in Python. More...
 
static MStatus getCurrentResult (MIntArray &val)
 This method gets the current node's result as an array of integers, if possible. More...
 
static MStatus getCurrentResult (MDoubleArray &val)
 This method gets the current node's result as an array of doubles, if possible. More...
 
static MStatus getCurrentResult (MStringArray &val)
 This method gets the current node's result as an array of strings, if possible. More...
 
static int currentIntResult (MStatus *ReturnStatus=NULL)
 This method gets the current node's result as a int, if possible. More...
 
static double currentDoubleResult (MStatus *ReturnStatus=NULL)
 This method gets the current node's result as a double, if possible. More...
 
static MString currentStringResult (MStatus *ReturnStatus=NULL)
 This method gets the current node's result as a MString, if possible. More...
 
static const char * className ()
 Returns the name of this class. More...
 

Additional Inherited Members

- Public Types inherited from MPxCommand
enum  MResultType { kLong, kDouble, kString, kNoArg }
 Types of results from commands. More...
 
- Protected Member Functions inherited from MPxToolCommand
MStatus doFinalize (MArgList &command)
 USE _doFinalize() IN SCRIPT. More...
 

Detailed Description

Base class used for moving polygon UV's.

This is the base class for UV editing interactive commands on polygonal objects.

The purpose of this tool command class is to simplify the process of moving UVs on a polygonal object. The use is only required to provide the new positions of the UVs that being modified, and finalize at the end of editing.

Examples:
grabUVMain.cpp.

Member Function Documentation

void setUVs ( const MObject mesh,
MIntArray uvList,
MFloatArray uPos,
MFloatArray vPos,
const MString uvSet = NULL 
)

This method sets the uv to new values.

Call this method during the editting, for example mouse drag.

Parameters
[in]meshThe mesh object to be modified
[in]uvListThe list of UV Ids selected by the user.
[in]uPosThe new u values corresponding to the indices listed in uvList.
[in]vPosThe new v values corresponding to the indices listed in uvList.
[in]uvSetUV set to work with
bool isUndoable ( ) const
overridevirtual

This method is used to specify whether or not the command is undoable.

In the base class, it always returns false. If you are writing a command that might be eligible for undo, you should override this method.

After Maya executes the command's doIt method, it will call isUndoable. If isUndoable returns true, Maya will retain the instance of the class and pass it to Maya's undo manager so that the undoIt and redoIt methods can be called when appropriate. If isUndoable returns false, the command instance will be immediately destroyed.

So, for example, if a command supports both query and edit modes, in query mode the command should set a flag so that the isUndoable method returns false to prevent that command instance from being retained by the undo manager. In edit mode, where the state of Maya is changed, isUndoable should return true to enable undo and redo.

Returns
  • true This command is undoable
  • false This command is not undoable (default)

Reimplemented from MPxCommand.

MStatus doIt ( const MArgList args)
overridevirtual

This method should perform a command by setting up internal class data and then calling the redoIt method.

The actual action performed by the command should be done in the redoIt method. This is a pure virtual method, and must be overridden in derived classes.

Parameters
[in]argsList of arguments passed to the command.
Returns
Status code
Status Codes:
  • MS::kSuccess The command was successful
  • MS::kFailure An error occured during the command

Implements MPxToolCommand.

MStatus cancel ( )
overridevirtual

This method cancels the command.

Returns
Status code
Status Codes:
  • MS::kSuccess The cancel was successfull.
  • MS::kFailure Object error.

Reimplemented from MPxToolCommand.

MStatus finalize ( )
overridevirtual

This method finishs the editing of uv.

It will register the command with the undo manager for journalling. Call this method at the end of editing, for example mouse release.

Returns
Status code
Status Codes:
  • MS::kSuccess The finalize was successfull.
  • MS::kFailure Object error.

Reimplemented from MPxToolCommand.

const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

The documentation for this class was generated from the following files: