C++ API Reference

Static class providing common API global functions. More...

#include <MGlobal.h>

Public Types

enum  MMayaState { kInteractive, kBatch, kLibraryApp, kBaseUIMode }
 State in which Maya has been started. More...
 
enum  ListAdjustment {
  kReplaceList, kXORWithList, kAddToList, kRemoveFromList,
  kAddToHeadOfList
}
 Operations on selection lists. More...
 
enum  SelectionMethod { kSurfaceSelectMethod, kWireframeSelectMethod }
 Choices for types of selection methods used in the selectFromScreen functions. More...
 
enum  MSelectionMode {
  kSelectObjectMode, kSelectComponentMode, kSelectRootMode, kSelectLeafMode,
  kSelectTemplateMode
}
 Global selection modes. More...
 
enum  MIdleTaskPriority { kHighIdlePriority, kLowIdlePriority, kVeryLowIdlePriority }
 Priority for idle task. More...
 
typedef void(* MIdleTaskCallback) (void *clientData)
 Definition for callback function for executeTaskOnIdle()
 

Static Public Member Functions

static MString mayaVersion ()
 Returns a string describing this version of Maya. More...
 
static int apiVersion ()
 Returns a number describing the version of the Maya API at runtime. More...
 
static bool isCustomVersion ()
 Returns true if this is a custom version of Maya. More...
 
static MString customVersionString ()
 Returns a string describing the custom version of Maya at runtime. More...
 
static int customVersionMajor ()
 Returns a number describing the major custom version of Maya at runtime. More...
 
static int customVersionMinor ()
 Returns a number describing the minor custom version of Maya at runtime. More...
 
static MString customVersionClient ()
 Returns a string describing the custom version client of Maya at runtime. More...
 
static int customVersion ()
 Returns an encoded number describing the custom version of Maya at runtime. More...
 
static MString getAbsolutePathToResources ()
 Return the absolute path of Maya's "Resources" fold on the system, including the "Resources" folder itself. More...
 
static bool isDefaultLanguage ()
 Returns True when no specific localization has been requested, or the localization requested was not supported or installed. More...
 
static MString getUILanguage ()
 Return standardized string identifier representing the UI language to use. More...
 
static MMayaState mayaState (MStatus *ReturnStatus=NULL)
 Returns an enumerated type specifying the way in which Maya was invoked. More...
 
static MStatus getFunctionSetList (MObject forObject, MStringArray &array)
 Gets a list of strings that represent the type of each function set that will accept this object. More...
 
static MStatus getAssociatedSets (const MSelectionList &list, MObjectArray &setArray)
 This utility method finds all the sets that the items in the given selection list are members of. More...
 
static MStatus getSelectionListByName (const MString &name, MSelectionList &list)
 This method fills a selection list with all of the objects that match a specified name. More...
 
static MStatus getActiveSelectionList (MSelectionList &dest, bool orderedSelectionIfAvailable=false)
 Returns a copy of the active selection list, or optionally a copy of the ordered active selection list. More...
 
static MStatus getRichSelection (MRichSelection &dest, bool defaultToActiveSelection=true)
 Returns the current rich selection (usually the active selection with any soft selection and symmetry applied). More...
 
static MStatus getLiveList (MSelectionList &dest)
 Returns a copy of the live list. More...
 
static MStatus getHiliteList (MSelectionList &dest)
 Returns a copy of the hilite list. More...
 
static MStatus setHiliteList (MSelectionList &src)
 Sets the current hilite list. More...
 
static MStatus setActiveSelectionList (const MSelectionList &src, ListAdjustment=kReplaceList)
 Set the active selection list. More...
 
static MStatus setRichSelection (const MRichSelection &src)
 Set the current rich selection. More...
 
static MStatus setDisplayCVs (MSelectionList &, bool)
 Controls drawing of control points in the specified selection list. More...
 
static MStatus selectCommand (const MSelectionList &src, ListAdjustment=kReplaceList)
 Set the active selection list, by calling the built in Maya select command. More...
 
static MStatus selectByName (const MString &name, ListAdjustment=kAddToList)
 Puts objects that match the give name on the active selection list. More...
 
static MStatus unselectByName (const MString &name)
 Removes objects matching the pattern from the active selection list. More...
 
static MStatus select (MObject &object, ListAdjustment=kAddToList)
 Put the given object on the active selection list. More...
 
static MStatus select (const MDagPath &object, const MObject &component, ListAdjustment=kAddToList)
 Put the given object or components on the active selection list. More...
 
static MStatus unselect (MObject &object)
 Remove the given object from the active selection list. More...
 
static MStatus unselect (const MDagPath &object, const MObject &component)
 Remove the given object/components from the active selection list. More...
 
static MStatus selectFromScreen (const short &x_pos, const short &y_pos, ListAdjustment=kAddToList, SelectionMethod=kWireframeSelectMethod)
 Perform click-pick type selection on the dag. More...
 
static MStatus selectFromScreen (const short &start_x, const short &start_y, const short &end_x, const short &end_y, ListAdjustment=kAddToList, SelectionMethod=kWireframeSelectMethod)
 Perform marquee type selection on the dag. More...
 
static SelectionMethod selectionMethod (MStatus *ReturnStatus=NULL)
 Determines the selection method that should be used in the currently active viewport. More...
 
static MSelectionMode selectionMode (MStatus *ReturnStatus=NULL)
 Determines Maya's selection mode. More...
 
static MStatus setSelectionMode (MSelectionMode mode)
 Sets the selection mode. More...
 
static MSelectionMask objectSelectionMask (MStatus *ReturnStatus=NULL)
 Returns the object selection mask. More...
 
static MStatus setObjectSelectionMask (const MSelectionMask &mask)
 Set the object selection mask to the supplied value. More...
 
static MSelectionMask componentSelectionMask (MStatus *ReturnStatus=NULL)
 Returns the component selection mask. More...
 
static MStatus setComponentSelectionMask (const MSelectionMask &mask)
 Set the component selection mask to the supplied value. More...
 
static MSelectionMask animSelectionMask (MStatus *ReturnStatus=NULL)
 Returns the animation selection mask. More...
 
static MStatus setAnimSelectionMask (const MSelectionMask &mask)
 Set the animation selection mask to the supplied value. More...
 
static MSelectionMask miscSelectionMask (MStatus *ReturnStatus=NULL)
 Returns the miscellaneous selection mask. More...
 
static MStatus setMiscSelectionMask (const MSelectionMask &mask)
 Set the miscellaneous selection mask to the supplied value. More...
 
static MStatus clearSelectionList ()
 Removes all items from the active selection list. More...
 
static bool isSelected (MObject &object, MStatus *ReturnStatus=NULL)
 Determines whether the given object is on the active selection list. More...
 
static bool trackSelectionOrderEnabled (MStatus *ReturnStatus=NULL)
 Returns whether the selection order is currerntly being tracked. More...
 
static MStatus setTrackSelectionOrderEnabled (bool enable)
 Set whether Maya should maintain an active selection list which maintains object and component selection order. More...
 
static MStatus getPreselectionHiliteList (MSelectionList &list)
 Gets the objects for which Maya is displaying a preselection highlight in the viewports. More...
 
static MStatus setPreselectionHiliteList (const MSelectionList &list)
 Sets the objects for which Maya will display a preselection highlight in the viewports. More...
 
static MObject currentToolContext ()
 Returns the current tool context as an MObject. More...
 
static MStatus viewFrame (const MTime &time)
 Sets the global time to the specified time. More...
 
static MStatus viewFrame (double time)
 Sets the global time to the specified time. More...
 
static MStatus sourceFile (const MString &fileName)
 Causes the MEL command engine to open the named file and execute the contents of the file as a MEL script. More...
 
static MStatus executeCommandOnIdle (const MString &command, bool displayEnabled=false)
 Sets a MEL command to execute on the next idle event. More...
 
static MStatus executeCommand (const MString &command, bool displayEnabled=false, bool undoEnabled=false)
 Executes a MEL command with no access to result. More...
 
static MStatus executeCommand (const MString &command, MCommandResult &result, bool displayEnabled=false, bool undoEnabled=false)
 Executes a MEL command that returns an MCommandResult from the command engine. More...
 
static MStatus executeCommand (const MString &command, int &result, bool displayEnabled=false, bool undoEnabled=false)
 Executes a MEL command that returns an integer result from the command engine. More...
 
static MStatus executeCommand (const MString &command, MIntArray &result, bool displayEnabled=false, bool undoEnabled=false)
 Executes a MEL command that returns an integer array result from the command engine. More...
 
static MStatus executeCommand (const MString &command, double &result, bool displayEnabled=false, bool undoEnabled=false)
 Executes a MEL command that returns a double result from the command engine. More...
 
static MStatus executeCommand (const MString &command, MDoubleArray &result, bool displayEnabled=false, bool undoEnabled=false)
 Executes a MEL command that returns a double array result from the command engine. More...
 
static MStatus executeCommand (const MString &command, MStringArray &result, bool displayEnabled=false, bool undoEnabled=false)
 Executes a MEL command that returns a string array result from the command engine. More...
 
static MString executeCommandStringResult (const MString &command, bool displayEnabled=false, bool undoEnabled=false, MStatus *ResultStatus=NULL)
 Executes a MEL command that returns a string result from the command engine. More...
 
static MStatus executeCommand (const MString &command, MString &result, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MStatus executeTaskOnIdle (MIdleTaskCallback task, void *clientData=NULL, MIdleTaskPriority priority=kLowIdlePriority)
 This method is not available in Python. More...
 
static MStatus executePythonCommand (const MString &command, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MStatus executePythonCommand (const MString &command, int &result, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MStatus executePythonCommand (const MString &command, MIntArray &result, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MStatus executePythonCommand (const MString &command, double &result, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MStatus executePythonCommand (const MString &command, MDoubleArray &result, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MString executePythonCommandStringResult (const MString &command, bool displayEnabled=false, bool undoEnabled=false, MStatus *ReturnStatus=NULL)
 This method is not available in Python. More...
 
static MStatus executePythonCommand (const MString &command, MString &result, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MStatus executePythonCommand (const MString &command, MStringArray &result, bool displayEnabled=false, bool undoEnabled=false)
 This method is not available in Python. More...
 
static MStatus executePythonCommandOnIdle (const MString &command, bool displayEnabled=false)
 This method is not available in Python. More...
 
static PyObject * callPythonFunction (PyObject *func, PyObject *args)
 This method is not available in Python.
 
static void catchAndReportPythonException ()
 This method is not available in Python.
 
static void formatPythonError (PyObject *exception, const char *format, va_list args)
 This method is not available in Python.
 
static MStatus addToModel (MObject &object, MObject &parent=MObject::kNullObj)
 This method is used to add new dag objects to the model. More...
 
static MStatus addToModelAt (MObject &, const MVector &point, const double scale[3]=NULL, const double rotation[3]=NULL, MTransformationMatrix::RotationOrder order=MTransformationMatrix::kXYZ)
 Adds the specified dag object to the DAG and transform the object by the specified arguments. More...
 
static MStatus removeFromModel (MObject &)
 Removes the specified dag node from the scene. More...
 
static MStatus deleteNode (MObject &)
 Delete the given dag node or dependency graph node. More...
 
static MStatus setYAxisUp (bool rotateView=false)
 This method sets the flag to identify which axis is Up, and rotates the ground plane around around the X-axis 90 degrees to get the Y-Up from Z-Up. More...
 
static MStatus setZAxisUp (bool rotateView=false)
 This method sets the flag to identify which axis is Up, and rotates the ground plane around around the X-axis -90 degrees to get the Z-Up from Y-Up. More...
 
static bool isYAxisUp (MStatus *=NULL)
 This method returns true if, currently, the Y-axis is UP. More...
 
static bool isZAxisUp (MStatus *=NULL)
 This method returns true if, currently, the Z-axis is UP. More...
 
static MVector upAxis (MStatus *=NULL)
 This method returns the model's current up axis. More...
 
static void displayInfo (const MString &theMessage)
 This method is used to display an informational message in the script editor. More...
 
static void displayWarning (const MString &theWarning)
 This method is used to display a warning in the script editor. More...
 
static void displayError (const MString &theError)
 This method is used to display an error in the script editor. More...
 
static void setDisableStow (bool state)
 This method is used to make the visiblity of all Maya windows unchangable. More...
 
static bool disableStow ()
 This method is used to query if the disabling of Stowing (hiding) and Unstowing (showing) windows is active. More...
 
static int optionVarIntValue (const MString &name, bool *exists=NULL)
 This method is used to get the option variable value of int type. More...
 
static double optionVarDoubleValue (const MString &name, bool *exists=NULL)
 This method is used to get the option variable value of type double. More...
 
static MString optionVarStringValue (const MString &name, bool *exists=NULL)
 This method is used to get the option variable value of type string. More...
 
static bool setOptionVarValue (const MString &name, int value)
 This method is used to set the option variable value of int type. More...
 
static bool setOptionVarValue (const MString &name, double value)
 This method is used to set the option variable value of type double. More...
 
static bool setOptionVarValue (const MString &name, MString value)
 This method is used to set the option variable value of type string. More...
 
static void removeOptionVar (const MString &name)
 This method is used to remove the option variable. More...
 
static bool optionVarExists (const MString &name)
 This method is used to check if the option variable exists. More...
 
static MString defaultErrorLogPathName (MStatus *ReturnStatus=NULL)
 Determines the default path name of the error log file. More...
 
static MStatus resetToDefaultErrorLogPathName ()
 Closes the current log file if it is open, and then resets the log path to the default path. More...
 
static MStatus setErrorLogPathName (const MString &logPathName)
 Closes the current log file if it is open, and then sets the log path to the given path. More...
 
static MString errorLogPathName (MStatus *ReturnStatus=NULL)
 Determines the path name of the current error log file. More...
 
static MStatus startErrorLogging ()
 This method enables output to the API error log. More...
 
static MStatus startErrorLogging (const MString &logPathName)
 This method enables output to the API error log file specified by the path. More...
 
static bool errorLoggingIsOn (MStatus *ReturnStatus=NULL)
 This method determines whether or not API errors are being logged. More...
 
static MStatus stopErrorLogging ()
 This method disables output to the API error log but does not close the log file. More...
 
static MStatus closeErrorLog ()
 This method closes the API error log file. More...
 
static MStatus doErrorLogEntry (const MString &errorLogEntry)
 Logs an entry in the currently open log file. More...
 
static bool isUndoing ()
 Returns true if Maya is currently in the middle of an undo. More...
 
static bool isRedoing ()
 Returns true if Maya is currently in the middle of an redo. More...
 
static const char * className ()
 Returns the name of this class. More...
 
static bool getOptionVarValue (const MString &name, int &value)
 This method is not available in Python. More...
 
static bool getOptionVarValue (const MString &name, double &value)
 This method is not available in Python. More...
 
static bool getOptionVarValue (const MString &name, MString &value)
 This method is not available in Python. More...
 
static MStatus select (MDagPath &object, const MObject &component, ListAdjustment=kAddToList)
 This method is not available in Python. More...
 
static MStatus unselect (MDagPath &object, const MObject &component)
 This method is not available in Python. More...
 

Detailed Description

Static class providing common API global functions.

Provide methods for selection, 3D-views, time, model manipulation and MEL commands.

MGlobal is a static class which provides access to Maya's model (3d graphical database).

MGlobal provides methods for selection, 3d-views, setting the global time, adding to the DAG, and executing MEL commands from within the API. There are multiple methods provided in this class for executing MEL within the API. Plug-ins requiring the execution of MEL from the non-main Maya thread must use the executeCommandOnIdle() method to avoid program errors.

MGlobal also provides methods for controlling error logging in the API.

Examples:
apiMeshShape/apiMeshGeometryOverride.cpp, apiMeshShape/apiMeshSubSceneOverride.cpp, and hwApiTextureTest/hwRendererHelperDX.cpp.

Member Enumeration Documentation

enum MMayaState

State in which Maya has been started.

Enumerator
kInteractive 

Running with a UI.

kBatch 

Running without a UI.

kLibraryApp 

Running as a standalone (MLibrary) application.

kBaseUIMode 

Running with UI enabled but Maya's std UI scripts not run.

Operations on selection lists.

Enumerator
kReplaceList 

Totally replace the list with the given items.

kXORWithList 

Any of the items which are already on the list will be removed.

Any which are not already on the list will be added to the end of the list.

kAddToList 

Add the items to the end of the list.

kRemoveFromList 

Remove the items from the list.

kAddToHeadOfList 

Add the items to the beginning of the list.

Choices for types of selection methods used in the selectFromScreen functions.

Enumerator
kSurfaceSelectMethod 

Select based on the surface of the objects.

kWireframeSelectMethod 

Select based on the wireframe of the objects.

Global selection modes.

Enumerator
kSelectObjectMode 

Select objects.

kSelectComponentMode 

Select components.

kSelectRootMode 

Select DAG roots.

kSelectLeafMode 

Select DAG leaves.

kSelectTemplateMode 

Select templated objects.

Priority for idle task.

Enumerator
kHighIdlePriority 

High priority.

kLowIdlePriority 

Low priority.

kVeryLowIdlePriority 

Very low priority.

Member Function Documentation

OPENMAYA_MAJOR_NAMESPACE_OPEN MString mayaVersion ( )
static
int apiVersion ( )
static

Returns a number describing the version of the Maya API at runtime.

Returns
The current API version
bool isCustomVersion ( )
static

Returns true if this is a custom version of Maya.

Returns
A boolean indicating whether this is a custom version of Maya
MString customVersionString ( )
static

Returns a string describing the custom version of Maya at runtime.

Returns
A current custom Maya version or an empty string if this is not a custom version
int customVersionMajor ( )
static

Returns a number describing the major custom version of Maya at runtime.

Returns
The current custom Maya major version or zero if not a custom version
int customVersionMinor ( )
static

Returns a number describing the minor custom version of Maya at runtime.

Returns
The current custom Maya minor version
MString customVersionClient ( )
static

Returns a string describing the custom version client of Maya at runtime.

Returns
The current custom Maya client or an empty string if this is not a custom version
int customVersion ( )
static

Returns an encoded number describing the custom version of Maya at runtime.

This number can be used to compare custom versions of Maya and is encoded as (10000 * maya_major_version + 100 * custom_major_version + custom_minor_version). Note: If this is not a custom version then (10000 * maya_major_version) will be returned.

Returns
An encoded number describing the custom version of Maya.
MString getAbsolutePathToResources ( )
static

Return the absolute path of Maya's "Resources" fold on the system, including the "Resources" folder itself.

Returns
An MString object containing the absolute path to the "Resources" folder
bool isDefaultLanguage ( )
static

Returns True when no specific localization has been requested, or the localization requested was not supported or installed.

Returns
Returns true if the current UI language is the default (en_US).
MString getUILanguage ( )
static

Return standardized string identifier representing the UI language to use.

This will either be a localized language, or the default language.

Returns
An MString object containing the standardized identifier
MGlobal::MMayaState mayaState ( MStatus ReturnStatus = NULL)
static

Returns an enumerated type specifying the way in which Maya was invoked.

Parameters
[out]ReturnStatusStatus code.
Returns
Status Codes:
  • MS::kSuccess Method was successful
  • MS::kFailure Object error
Examples:
autoLoader/autoLoader.cpp, cgFx/cgfxShaderCmd.cpp, cgFx/pluginMain.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderPluginMain.cpp, glslShader/GLSLShader.cpp, glslShader/GLSLShaderMainMaya.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCachePluginMain.cpp, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheVramQuery.cpp, hlslShader/hlslPluginMain.cpp, and sceneAssembly/sceneAssemblyPluginMain.cpp.
MStatus getFunctionSetList ( MObject  forObject,
MStringArray array 
)
static

Gets a list of strings that represent the type of each function set that will accept this object.

The strings match the values in MFn.h.

Parameters
[in]forObjectobject to get list of function sets for
[out]arraystorage for the array of strings
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
Examples:
whatisCmd/whatisCmd.cpp.
MStatus getAssociatedSets ( const MSelectionList list,
MObjectArray setArray 
)
static

This utility method finds all the sets that the items in the given selection list are members of.

Parameters
[in]listitems to finds sets for
[out]setArraystorage for the array of sets
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure An error occurred while getting the sets
MStatus getSelectionListByName ( const MString name,
MSelectionList list 
)
static

This method fills a selection list with all of the objects that match a specified name.

The name may use the same type of regular expressions the can be used in MEL commands. For example, the pattern "pCube*" will match all occurances of objects that begin their names with "pCube".

Taking this a step further, the following example looks for all objects that both start their names with "pCube" but also have a child that starts its name with "pCubeShape". Since the pattern is matching a DAG path, the items that match the pattern should be DAG nodes.

MStatus testCommand::doIt()
{
MString toMatch ("pCube*|pCubeShape*");
unsigned int ii = 0;
unsigned int nMatches = sList.length();
for (ii = 0; ii < nMatches; ++ii) {
sList.getDagPath(ii, dp);
cout << dp.fullPathName() << endl;
}
return MS::kSuccess ;
}

For the case where a polyCube (pCube1) is the parent of another polyCube (pCube2), the output of the above example would be as follows:

|pCube1|pCubeShape1 |pCube1|pCube2|pCubeShape2

Parameters
[in]nameRegular expression to match object name.
[out]listSelection list into which the objects matching the name will be placed.
Returns
Status code
Status Codes:
  • MS::kSuccess Objects matching the name were successfully found
  • MS::kFailure Error getting the objects.
MStatus getActiveSelectionList ( MSelectionList dest,
bool  orderedSelectionIfAvailable = false 
)
static

Returns a copy of the active selection list, or optionally a copy of the ordered active selection list.

This is the active selection list but with components as well as objects appearing in the order that they were selected.

In order to get the ordered selection list, tracking component selection order must be enabled through either the 'selectPref' Maya command or through the MGlobal function 'setTrackSelectionOrderEnabled'.

Parameters
[out]destStorage for the selection list
[in]orderedSelectionIfAvailableIf true, and tracking is enabled, will return the selected items in the order that they were selected.
Returns
Status code
Status Codes:
  • MS::kSuccess Active selection list was successfully returned
  • MS::kFailure Error getting the active selection list
Examples:
AbcBullet/AbcBullet.cpp, AbcBullet/AbcWriteJob.cpp, AbcExport/AbcExport.cpp, AbcExport/AbcWriteJob.cpp, animExportUtil/animExportUtil.cpp, animImportExport/animImportExport.cpp, apiMeshShape/apiMeshSubSceneOverride.cpp, atomImportExport/atomFileUtils.cpp, atomImportExport/atomImportExport.cpp, blindComplexDataCmd/blindComplexDataCmd.cpp, blindDoubleDataCmd/blindDoubleDataCmd.cpp, blindShortDataCmd/blindShortDataCmd.cpp, cameraSetSubclass/testExCameraSetCmd.cpp, cgFx/cgfxAttrDef.cpp, cgFx/cgfxShaderCmd.cpp, cleanPerFaceAssignment/cleanPerFaceAssignmentCmd.cpp, closestPointOnNurbsSurfaceCmd/closestPointOnNurbsSurfaceCmd.cpp, clusterWeightFunction/clusterWeightFunction.cpp, componentScaleManip/componentScaleManip.cpp, convertEdgesToFacesCmd/convertEdgesToFacesCmd.cpp, convertVerticesToEdgesCmd/convertVerticesToEdgesCmd.cpp, convertVerticesToFacesCmd/convertVerticesToFacesCmd.cpp, createClipCmd/createClipCmd.cpp, customAttrManip/customAttrManip.cpp, cvExpandCmd/cvExpandCmd.cpp, cvPosCmd/cvPosCmd.cpp, dagPoseInfoCmd/dagPoseInfoCmd.cpp, findFileTexturesCmd/findFileTexturesCmd.cpp, findTexturesPerPolygonCmd/findTexturesPerPolygonCmd.cpp, fragmentDumper/fragmentDumper.cpp, getAttrAffectsCmd/getAttrAffectsCmd.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheSubSceneOverride.cpp, helix2Cmd/helix2Cmd.cpp, hwApiTextureTest/hwApiTextureTest.cpp, instancerListCmd/instancerListCmd.cpp, intersectOnNurbsSurfaceCmd/intersectOnNurbsSurfaceCmd.cpp, lassoTool/lassoTool.cpp, latticeNoise/latticeNoiseCmd.cpp, lepTranslator/lepTranslator.cpp, lineManip/lineManip.cpp, lineManipContainer/lineManipContainer.cpp, listLightLinksCmd/listLightLinksCmd.cpp, listPolyHolesCmd/listPolyHolesCmd.cpp, manipOverride/customTriadManip.cpp, manipOverride/manipOverride.cpp, marqueeTool/marqueeTool.cpp, meshOpCmd/meshOpCmd.cpp, motionPathCmd/motionPathCmd.cpp, motionTraceCmd/motionTraceCmd.cpp, moveCurveCVsCmd/moveCurveCVsCmd.cpp, moveManip/moveManip.cpp, moveNumericTool/moveNumericTool.cpp, moveTool/moveTool.cpp, narrowPolyViewer/narrowPolyViewer.cpp, nodeInfoCmd/nodeInfoCmd.cpp, nodeMessageCmd/nodeMessageCmd.cpp, objExport/objExport.cpp, pointManip/pointManip.cpp, pointOnMeshInfo/pointOnMeshCmd.cpp, polyMessageCmd/polyMessageCmd.cpp, polyRawExporter/polyExporter.cpp, polyX3DExporter/polyExporter.cpp, rotateManip/rotateManip.cpp, spiralAnimCurveCmd/spiralAnimCurveCmd.cpp, splitUVCmd/splitUVCmd.cpp, squareScaleManip/squareScaleManip.cpp, squareScaleManipContext/squareScaleManipContext.cpp, surfaceBumpManip/surfaceBumpManip.cpp, surfaceTwistCmd/surfaceTwistCmd.cpp, testCameraSetCmd/testCameraSetCmd.cpp, threadedBoundingBox/threadedBoundingBox.cpp, translateCmd/translateCmd.cpp, viewRenderOverride/viewRenderOverrideOperations.cpp, viewRenderOverridePointLightShadows/viewRenderOverridePointLightShadows.cpp, viewRenderOverrideShadows/viewRenderOverrideShadows.cpp, and whatisCmd/whatisCmd.cpp.
MStatus getRichSelection ( MRichSelection richSelection,
bool  defaultToActiveSelection = true 
)
static

Returns the current rich selection (usually the active selection with any soft selection and symmetry applied).

Optionally if no rich selection exists, the current active selection can be returned instead (reducing the need for duplicated code).

Parameters
[out]richSelectionStorage for the rich selection
[in]defaultToActiveSelectionIf true, Maya will return the active selection when no rich selection exists.
Returns
Status code
Status Codes:
  • MS::kSuccess Rich selection was successfully returned
  • MS::kFailure Error getting the rich selection
Examples:
listRichSelectionCmd/listRichSelectionCmd.cpp, and richMoveCmd/richMoveCmd.cpp.
MStatus getLiveList ( MSelectionList dest)
static

Returns a copy of the live list.

When a user performs a "Modify->Make Live" in the user interface the currently selected objects are added to the live list.

Parameters
[out]destStorage for the selection list
Returns
Status code
Status Codes:
  • MS::kSuccess Live list was successfully returned
  • MS::kFailure Error getting the live list
MStatus getHiliteList ( MSelectionList dest)
static

Returns a copy of the hilite list.

The hilite list contains all DAG objects that are hilited for component selection mode. (e.g. when the user right clicks over a Mesh object and chooses the "vertex" option the Mesh line drawing changes color and the mesh is added to the hiliteList.)

Parameters
[out]destStorage for the hilite list
Returns
Status code
Status Codes:
  • MS::kSuccess Hilite list was successfully returned
  • MS::kFailure Error getting the hilite list
MStatus setHiliteList ( MSelectionList list)
static

Sets the current hilite list.

The current selection list is unchanged.

Parameters
[in]listThe new hilite list.
Returns
Status code
Status Codes:
  • MS::kSuccess Hilite list was successfully set
  • MS::kFailure Error setting the hilite list
MStatus setActiveSelectionList ( const MSelectionList src,
MGlobal::ListAdjustment  listAdjustment = kReplaceList 
)
static

Set the active selection list.

The selection items on the given list will update the contents of the active selection list as indicated by the listAdjustment parameter.

Parameters
[in]srcThe source list
[in]listAdjustmentDetermines how the active selection list is modified. kReplaceList - totally replace the active list with the given items. kXORWithList - if one of the given items is in the active list take it out, otherwise add it to the active list. kAddToList - add the items to the list kRemoveFromList - remove the items from the list kAddToHeadOfList - add the items to beginning of the list
Returns
Status code
Status Codes:
  • MS::kSuccess Active selection list was successfully set
  • MS::kFailure Error setting the active selection list
Examples:
atomImportExport/atomImportExport.cpp, cgFx/cgfxAttrDef.cpp, cgFx/cgfxShaderCmd.cpp, convertEdgesToFacesCmd/convertEdgesToFacesCmd.cpp, convertVerticesToEdgesCmd/convertVerticesToEdgesCmd.cpp, convertVerticesToFacesCmd/convertVerticesToFacesCmd.cpp, gpuCache/gpuCacheCmd.cpp, lassoTool/lassoTool.cpp, listLightLinksCmd/listLightLinksCmd.cpp, marqueeTool/marqueeTool.cpp, and narrowPolyViewer/narrowPolyViewer.cpp.
MStatus setRichSelection ( const MRichSelection src)
static

Set the current rich selection.

Parameters
[in]srcThe source list
Returns
Status code
Status Codes:
  • MS::kSuccess Rich selection list was successfully set
  • MS::kFailure Error setting the rich selection list
MStatus setDisplayCVs ( MSelectionList src,
bool  state 
)
static

Controls drawing of control points in the specified selection list.

The selection items on the given list will be marked for drawing. This overrides Maya's current draw list and allow, for example, the drawing of control points without being in vertex selection mode.

Parameters
[in]srcThe source list
[in]stateWhether items should be marked on/off for drawing
Returns
Status code
Status Codes:
  • MS::kSuccess Selection list was successfully set
  • MS::kFailure Could not change the display of the selection list
MStatus selectCommand ( const MSelectionList src,
MGlobal::ListAdjustment  listAdjustment = kReplaceList 
)
static

Set the active selection list, by calling the built in Maya select command.

This differs from setActiveSelectionList in that in this version Maya takes over the selection list you give it and will be responsible for maintaing the necessary information required for undo, redo, and journalling.

Parameters
[in]srcThe source list
[in]listAdjustmentDetermines how the active selection list is modified. kReplaceList - totally replace the active list with the given items. kXORWithList - if one of the given items is in the active list take it out, otherwise add it to the active list. kAddToList - add the items to the list kRemoveFromList - remove the items from the list kAddToHeadOfList - add the items to beginning of the list
Returns
Status code
Status Codes:
  • MS::kSuccess Active selection list was successfully set
  • MS::kFailure Error setting the active selection list
Examples:
lassoTool/lassoTool.cpp, and marqueeTool/marqueeTool.cpp.
MStatus selectByName ( const MString name,
MGlobal::ListAdjustment  listAdjustment = kAddToList 
)
static

Puts objects that match the give name on the active selection list.

Parameters
[in]nameRegular expression to match object name.
[in]listAdjustmentDetermines how the active selection list is modified. kReplaceList - totally replace the active list with the given items. kXORWithList - if one of the given items is in the active list take it out, otherwise add it to the active list. kAddToList - add the items to the list kRemoveFromList - remove the items from the list kAddToHeadOfList - add the items to beginning of the list
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
Examples:
atomImportExport/atomAnimLayers.cpp, atomImportExport/atomFileUtils.cpp, latticeNoise/latticeNoiseCmd.cpp, peltOverlapCmd/peltOverlapCmd.cpp, and pickCmd/pickCmd.cpp.
MStatus unselectByName ( const MString name)
static

Removes objects matching the pattern from the active selection list.

Parameters
[in]nameRegular expression to match object name.
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
MStatus select ( MObject object,
MGlobal::ListAdjustment  listAdjustment = kAddToList 
)
static

Put the given object on the active selection list.

Parameters
[in]objectObject to make selected.
[in]listAdjustmentDetermines how the active selection list is modified. kReplaceList - totally replace the active list with the given items. kXORWithList - if one of the given items is in the active list take it out, otherwise add it to the active list. kAddToList - add the items to the list kRemoveFromList - remove the items from the list kAddToHeadOfList - add the items to beginning of the list
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
  • MS::kInvalidParameter Invalid object specified
Examples:
cameraSetSubclass/testExCameraSetCmd.cpp, and testCameraSetCmd/testCameraSetCmd.cpp.
MStatus select ( const MDagPath object,
const MObject component,
MGlobal::ListAdjustment  listAdjustment = kAddToList 
)
static

Put the given object or components on the active selection list.

If the component is null then the object in the dag path will be selected, otherwise the given component will be selected.

Parameters
[in]objectObject to make selected.
[in]componentComponents to select.
[in]listAdjustmentDetermines how the active selection list is modified. kReplaceList - totally replace the active list with the given items. kXORWithList - if one of the given items is in the active list take it out, otherwise add it to the active list. kAddToList - add the items to the list kRemoveFromList - remove the items from the list kAddToHeadOfList - add the items to beginning of the list
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
MStatus unselect ( MObject object)
static

Remove the given object from the active selection list.

Parameters
[in]objectObject to unselect.
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
  • MS::kInvalidParameter Invalid object specified
MStatus unselect ( const MDagPath object,
const MObject component 
)
static

Remove the given object/components from the active selection list.

If components is null then the object will be unselected, otherwise the components will be unselected.

Parameters
[in]objectObject to unselect.
[in]componentComponents to be unselected.
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
MStatus selectFromScreen ( const short &  x_pos,
const short &  y_pos,
MGlobal::ListAdjustment  listAdjustment = kAddToList,
MGlobal::SelectionMethod  selectMethod = kWireframeSelectMethod 
)
static

Perform click-pick type selection on the dag.

If an object intersects the click point then it is selected according to listAdjustment.

Parameters
[in]x_posX position on screen to select at.
[in]y_posY position on screen to select at.
[in]listAdjustmentDetermines how the active selection list is modified. kReplaceList - totally replace the active list with the given items. kXORWithList - if one of the given items is in the active list take it out, otherwise add it to the active list. kAddToList - add the items to the list kRemoveFromList - remove the items from the list kAddToHeadOfList - add the items to beginning of the list
[in]selectMethodDetermines how the selection is done. kWireframeSelectMethod - selection point must hit the wireframe of an object for it to be selected. kSurfaceSelectMethod - selection point can hit anywhere on the surface of an object for it to be selected.
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
Examples:
lassoTool/lassoTool.cpp, and marqueeTool/marqueeTool.cpp.
MStatus selectFromScreen ( const short &  start_x,
const short &  start_y,
const short &  end_x,
const short &  end_y,
MGlobal::ListAdjustment  listAdjustment = kAddToList,
MGlobal::SelectionMethod  selectMethod = kWireframeSelectMethod 
)
static

Perform marquee type selection on the dag.

If an object intersects the selection rectangle, it is selected according to listAdjustment.

Parameters
[in]start_xStart x position of selection rectangle
[in]start_yStart y position of selection rectangle
[in]end_xEnd x position of selection rectangle
[in]end_yEnd y position of selection rectangle
[in]listAdjustmentDetermines how the active selection list is modified. kReplaceList - totally replace the active list with the given items. kXORWithList - if one of the given items is in the active list take it out, otherwise add it to the active list. kAddToList - add the items to the list kRemoveFromList - remove the items from the list kAddToHeadOfList - add the items to beginning of the list
[in]selectMethodDetermines how the selection is done. kWireframeSelectMethod - if part of the wireframe of an object falls inside the select rectangle then it will be selected. kSurfaceSelectMethod - if any part of of an object falls inside the select rectangle then it will be selected.
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
MGlobal::SelectionMethod selectionMethod ( MStatus ReturnStatus = NULL)
static

Determines the selection method that should be used in the currently active viewport.

This is useful as input to the "selectFromScreen" functions.

Parameters
[out]ReturnStatus
Returns
The selection method.
Status Codes:
  • MS::kSuccess Method successfully returned a result
  • MS::kFailure Error in getting active view
Examples:
marqueeTool/marqueeTool.cpp.
MGlobal::MSelectionMode selectionMode ( MStatus ReturnStatus = NULL)
static

Determines Maya's selection mode.

kSelectObjectMode – Objects are selected as a whole. Components are not directly accessible.

kSelectComponentMode – Components such as vertices are selectable in this mode.

kSelectRootMode – Selecting the child in a hierarchy will also select its root DAG node.

kSelectLeafMode – Selecting the child in a hierarchy will result only in that child being selected.

kSelectTemplateMode – Templated objects are selectable in this mode.

Parameters
[out]ReturnStatus
Returns
The selection mode.
Status Codes:
  • MS::kSuccess Method successfully returned a result
  • MS::kFailure Error in getting active model
Examples:
apiMeshShape/apiMeshGeometryOverride.cpp, and apiMeshShape/apiMeshSubSceneOverride.cpp.
MStatus setSelectionMode ( MGlobal::MSelectionMode  mode)
static

Sets the selection mode.

kSelectObjectMode – Objects are selected as a whole. Components are not directly accessible.

kSelectComponentMode – Components such as vertices are selectable in this mode.

kSelectRootMode – Selecting the child in a hierarchy will also select its root DAG node.

kSelectLeafMode – Selecting the child in a hierarchy will result only in that child being selected.

kSelectTemplateMode – Templated objects are selectable in this mode.

Parameters
[in]modeThe mode to be set
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection mode is set
  • MS::kFailure Error setting selection mode
MSelectionMask objectSelectionMask ( MStatus ReturnStatus = NULL)
static

Returns the object selection mask.

Parameters
[out]ReturnStatus
Returns
The selection mask
Status Codes:
  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask
MStatus setObjectSelectionMask ( const MSelectionMask mask)
static

Set the object selection mask to the supplied value.

Parameters
[in]maskThe mask to set to
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask
MSelectionMask componentSelectionMask ( MStatus ReturnStatus = NULL)
static

Returns the component selection mask.

Parameters
[out]ReturnStatus
Returns
The component selection mask
Status Codes:
  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask
Examples:
apiMeshShape/apiMeshGeometryOverride.cpp, and apiMeshShape/apiMeshSubSceneOverride.cpp.
MStatus setComponentSelectionMask ( const MSelectionMask mask)
static

Set the component selection mask to the supplied value.

Parameters
[in]maskThe mask to be set
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask
MSelectionMask animSelectionMask ( MStatus ReturnStatus = NULL)
static

Returns the animation selection mask.

Parameters
[out]ReturnStatus
Returns
The selection mask
Status Codes:
  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask
MStatus setAnimSelectionMask ( const MSelectionMask mask)
static

Set the animation selection mask to the supplied value.

Parameters
[in]maskThe mask to be set
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask
MSelectionMask miscSelectionMask ( MStatus ReturnStatus = NULL)
static

Returns the miscellaneous selection mask.

Parameters
[out]ReturnStatus
Returns
The selection mask
Status Codes:
  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask
MStatus setMiscSelectionMask ( const MSelectionMask mask)
static

Set the miscellaneous selection mask to the supplied value.

Parameters
[in]maskThe mask to be set
Returns
Status Code
Status Codes:
  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask
MStatus clearSelectionList ( )
static

Removes all items from the active selection list.

Returns
Status Code
Status Codes:
  • MS::kSuccess Active selection list was successfully cleared.
  • MS::kFailure Error clearing the active selection list.
Examples:
peltOverlapCmd/peltOverlapCmd.cpp.
bool isSelected ( MObject object,
MStatus ReturnStatus = NULL 
)
static

Determines whether the given object is on the active selection list.

Note: The given object must be a dependency node.

Parameters
[in]objectDependency node object to test.
[out]ReturnStatus
Returns
Boolean value: true if the object is selected, false otherwise.
Status Codes:
  • kSuccess Method successfully returned a result
  • kInvalidParameter A null MObject was provided
  • kFailure Error doing test
bool trackSelectionOrderEnabled ( MStatus ReturnStatus = NULL)
static

Returns whether the selection order is currerntly being tracked.

Parameters
[out]ReturnStatus
Returns
Boolean value: true if the selection order is being tracked, false otherwise.
Status Codes:
  • kSuccess Method successfully returned a result
  • kFailure Error doing test
MStatus setTrackSelectionOrderEnabled ( bool  enable)
static

Set whether Maya should maintain an active selection list which maintains object and component selection order.

Parameters
[in]enableFlag to enable or disable the tracking of selection order.
Returns
Status Code
Status Codes:
  • kSuccess Method successfully returned a result
  • kFailure Error setting value
MStatus getPreselectionHiliteList ( MSelectionList list)
static

Gets the objects for which Maya is displaying a preselection highlight in the viewports.

Parameters
[in]listStorage for the preselection highlight list.
Returns
Status Code
Status Codes:
  • kSuccess Method succeeded
  • kFailure Error getting value
MStatus setPreselectionHiliteList ( const MSelectionList list)
static

Sets the objects for which Maya will display a preselection highlight in the viewports.

The objects/components in the list will be drawn in Maya's preselection highlight style on the next viewport refresh (if preselection highlighting is enabled in the preferences).

If preselection highlighting is not enabled, Maya will still store the list.

Parameters
[in]listList of objects/components to highlight.
Returns
Status Code
Status Codes:
  • kSuccess Method succeeded
  • kFailure Error setting value
MObject currentToolContext ( )
static

Returns the current tool context as an MObject.

Returns
object representing the current tool context
MStatus viewFrame ( const MTime time)
static

Sets the global time to the specified time.

This function is optimized for sequential time values that are monotonically increasing. While one can set the time randomly with this function, a significant performance hit will be incurred.

Parameters
[in]timeTime to set.
Returns
Status Code
Status Codes:
  • MS::kSuccess global time set was successful
  • MS::kFailure Error setting view time
Examples:
AbcBullet/AbcBullet.cpp, AbcExport/AbcExport.cpp, AbcImport/AbcImport.cpp, animInfoCmd/animInfoCmd.cpp, and motionTraceCmd/motionTraceCmd.cpp.
MStatus viewFrame ( double  time)
static

Sets the global time to the specified time.

This function is optimized for sequential time values that are monotonically increasing. While one can set the time randomly with this function, a significant performance hit will be incurred.

Parameters
[in]timeTime to set, in the units currently in effect for the user interface.
Returns
Status Code
Status Codes:
  • MS::kSuccess global time set was successful
  • MS::kFailure Error setting view time
MStatus sourceFile ( const MString fileName)
static

Causes the MEL command engine to open the named file and execute the contents of the file as a MEL script.

If the provided fileName is a Unix absolute pathname, then that file is opened. If a relative pathname is provided, the directories indicated by the environment variable, MAYA_SCRIPT_PATH, will be searched for a matching filename.

Parameters
[in]fileNameThe name of a file containing MEL commands
Returns
Status Code
Status Codes:
  • MS::kSuccess the contents of the file executed successfully
  • MS::kFailure the contents of the file was not successfully executed.
Examples:
atomImportExport/atomImportExport.cpp, filteredAsciiFile/filteredAsciiFile.cpp, and sceneAssembly/sceneAssemblyPluginMain.cpp.
MStatus executeCommandOnIdle ( const MString command,
bool  displayEnabled = false 
)
static

Sets a MEL command to execute on the next idle event.

Since the command will likely not be executed until some time after control is returned to caller, there is no access to the command results.

This method is thread safe and can be called from a thread other than Maya's main thread. However, that thread must still be part of the Maya process. Calling this method from a completely separate process will not work and may lead to unpredictable behaviour.

Parameters
[in]commandThe MEL command string to add to idle queue.
[in]displayEnabledFlag to enable display of command in Script Editor - defaults to false
Returns
Status Code
Status Codes:
  • MS::kSuccess MEL command was successfully added to idle queue
  • MS::kFailure Error adding MEL command to idle queue
Examples:
AbcExport/AbcExport.cpp, AbcImport/main.cpp, autoLoader/moduleLogic.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderPluginMain.cpp, glslShader/GLSLShader.cpp, glslShader/GLSLShaderMainMaya.cpp, gpuCache/CacheReader.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCachePluginMain.cpp, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheUtil.h, manipOverride/manipOverride.cpp, randomizerDevice/randomizerDevice.cpp, and viewMRenderOverride/viewMRenderOverride.cpp.
MStatus executeCommand ( const MString command,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

Executes a MEL command with no access to result.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute.
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status Code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
Examples:
AbcBullet/AbcBullet.cpp, AbcBullet/AbcWriteJob.cpp, AbcExport/AbcExport.cpp, AbcExport/AbcWriteJob.cpp, AbcImport/AbcImport.cpp, AbcImport/AlembicImportFileTranslator.cpp, AbcImport/CreateSceneHelper.cpp, animImportExport/animImportExport.cpp, atomImportExport/atomAnimLayers.cpp, atomImportExport/atomFileUtils.cpp, atomImportExport/atomImportExport.cpp, atomImportExport/atomNodeNameReplacer.cpp, autoLoader/moduleLogic.cpp, captureViewRenderCmd/captureViewRenderCmd.cpp, cgFx/cgfxFindImage.cpp, cgFx/pluginMain.cpp, checkerShader/checkerShader.cpp, cleanPerFaceAssignment/cleanPerFaceAssignmentCmd.cpp, closestPointCmd/closestPointCmd.cpp, closestPointOnCurve/closestPointOnCurveCmd.cpp, closestPointOnNurbsSurfaceCmd/closestPointOnNurbsSurfaceCmd.cpp, customSpriteShader/customSpriteShader.cpp, customTextureShader/customTextureShaderOverride.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, dx11Shader/dx11ShaderPluginMain.cpp, externalDropCallback/externalDropCallback.cpp, footPrintNode_GeometryOverride/footPrintNode_GeometryOverride.cpp, footPrintNode_GeometryOverride_AnimatedMaterial/footPrintNode_GeometryOverride_AnimatedMaterial.cpp, footPrintNode_SubSceneOverride/footPrintNode_SubSceneOverride.cpp, glslShader/GLSLShader.cpp, glslShader/GLSLShaderMainMaya.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCachePluginMain.cpp, gpuCache/gpuCacheShapeNode.cpp, hwApiTextureTest/hwApiTextureTest.cpp, hwPhongShader/hwPhongShaderBehavior.cpp, instanceCallbackCmd/instanceCallbackCmd.cpp, intersectCmd/intersectCmd.cpp, intersectOnNurbsSurfaceCmd/intersectOnNurbsSurfaceCmd.cpp, lambertShader/lambertShader.cpp, lepTranslator/lepTranslator.cpp, manipOverride/manipOverride.cpp, maTranslator/maTranslator.cpp, MayaPluginForSpreticle/spReticleLoc.cpp, meshOpCmd/polyModifierCmd.cpp, nodeCreatedCBCmd/nodeCreatedCBCmd.cpp, objExport/objExport.cpp, peltOverlapCmd/peltOverlapCmd.cpp, pointOnMeshInfo/pointOnMeshCmd.cpp, progressWindowCmd/progressWindowCmd.cpp, qtForms.cpp, referenceQueryCmd/referenceQueryCmd.cpp, sampleParticles/sampleParticles.cpp, saveSwatchesCmd.cpp, sceneAssembly/adskRepresentations.cpp, sceneAssembly/assemblyDefinition.cpp, sceneAssembly/sceneAssemblyPluginMain.cpp, slopeShader/slopeShader.cpp, slopeShader/slopeShaderBehavior.cpp, splitUVCmd/polyModifierCmd.cpp, tessellatedQuad/TessellatedQuadGeomOverride.cpp, viewImageBlitOverride/viewImageBlitOverrideMain.cpp, and workspaceControlCmd.cpp.
MStatus executeCommand ( const MString command,
MCommandResult result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

Executes a MEL command that returns an MCommandResult from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute
[out]resultThe command result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status Code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
MStatus executeCommand ( const MString command,
int &  result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

Executes a MEL command that returns an integer result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute
[out]resultThe integer result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
MStatus executeCommand ( const MString command,
MIntArray result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

Executes a MEL command that returns an integer array result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute
[out]resultThe MIntArray result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
MStatus executeCommand ( const MString command,
double &  result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

Executes a MEL command that returns a double result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute
[out]resultThe double result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
MStatus executeCommand ( const MString command,
MDoubleArray result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

Executes a MEL command that returns a double array result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute
[out]resultThe MDoubleArray result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
MStatus executeCommand ( const MString command,
MStringArray result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

Executes a MEL command that returns a string array result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute
[out]resultThe MStringArray result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
MString executeCommandStringResult ( const MString command,
bool  displayEnabled = false,
bool  undoEnabled = false,
MStatus ReturnStatus = NULL 
)
static

Executes a MEL command that returns a string result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Parameters
[in]commandThe MEL command string to execute
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
[out]ReturnStatusOptional return status. See below.
Returns
String value returned by command
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
Examples:
atomImportExport/atomFileUtils.cpp, autoLoader/moduleLogic.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheShapeNode.cpp, peltOverlapCmd/peltOverlapCmd.cpp, and saveSwatchesCmd.cpp.
MStatus executeCommand ( const MString command,
MString result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a MEL command that returns a string result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executeCommandOnIdle instead.

Python Notes

This method is not supported in Python. Please see the executeCommandStringResult() function.

Parameters
[in]commandThe MEL command string to execute
[out]resultThe MString result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command
OPENMAYA_MAJOR_NAMESPACE_OPEN MStatus executeTaskOnIdle ( MIdleTaskCallback  task,
void *  clientData = NULL,
MIdleTaskPriority  priority = kLowIdlePriority 
)
static

This method is not available in Python.

Executes a customized task to execute on the next idle event.

This is a thread safe way to schedule a task for main thread to execute.

Parameters
[in]taskThe idle task callback
[in]clientDataOptional client data, maintained by the caller
[in]priorityThe idle task's priority to exectue - defaults to kLowIdlePriority
Returns
Status code
Status Codes:
  • MS::kSuccess The idle task was succesully added to thr idle queue
  • MS::kFailure Error when adding the idle task to idle queue
Examples:
captureViewRenderCmd/captureViewRenderCmd.cpp.
MStatus executePythonCommand ( const MString command,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a Python command with no access to result.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Parameters
[in]commandThe Python command string to execute.
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status Code
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
Examples:
AbcBullet/AbcWriteJob.cpp, AbcExport/AbcWriteJob.cpp, sceneAssembly/assemblyReferenceInitialRep.cpp, and sceneAssembly/sceneAssemblyPluginMain.cpp.
MStatus executePythonCommand ( const MString command,
int &  result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a Python command that returns an integer result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Parameters
[in]commandThe Python command string to execute
[out]resultThe integer result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
MStatus executePythonCommand ( const MString command,
MIntArray result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a Python command that returns an integer array result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Parameters
[in]commandThe Python command string to execute
[out]resultThe integer array result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
MStatus executePythonCommand ( const MString command,
double &  result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a Python command that returns a double result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Parameters
[in]commandThe Python command string to execute
[out]resultThe double result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
MStatus executePythonCommand ( const MString command,
MDoubleArray result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a Python command that returns a double array result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Parameters
[in]commandThe Python command string to execute
[out]resultThe double array result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
MString executePythonCommandStringResult ( const MString command,
bool  displayEnabled = false,
bool  undoEnabled = false,
MStatus ReturnStatus = NULL 
)
static

This method is not available in Python.

Executes a Python command that returns a string result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Parameters
[in]commandThe Python command string to execute
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
[out]ReturnStatusOptional return status. See below.
Returns
String returned from command
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
MStatus executePythonCommand ( const MString command,
MString result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a Python command that returns a string result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Python Notes

This method is not supported in Python. Please see the executePythonCommandStringResult() function.

Parameters
[in]commandThe Python command string to execute
[out]resultThe string result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
MStatus executePythonCommand ( const MString command,
MStringArray result,
bool  displayEnabled = false,
bool  undoEnabled = false 
)
static

This method is not available in Python.

Executes a Python command that returns a string array result from the command engine.

Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled. Optionally allows undo for the command to be enabled or disabled. Defaults to disabled.

Note: This is not thread safe; you may use executePythonCommandOnIdle instead.

Parameters
[in]commandThe Python command string to execute
[out]resultThe string array result
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
[in]undoEnabledFlag to enable addition of command to undo queue - defaults to false
Returns
Status code
Status Codes:
  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command
MStatus executePythonCommandOnIdle ( const MString command,
bool  displayEnabled = false 
)
static

This method is not available in Python.

Sets a Python command to execute on the next idle event.

This is a thread safe way to execute commands, however, there is no access to the command results. Optionally allows display of the command in the Command Window to be enabled or disabled. Defaults to disabled.

Parameters
[in]commandThe Python command string to add to idle queue.
[in]displayEnabledFlag to enable display of command in journal window - defaults to false
Returns
Status Code
Status Codes:
  • MS::kSuccess Python command was successfully added to idle queue
  • MS::kFailure Error adding Python command to idle queue
MStatus addToModel ( MObject object,
MObject parent = MObject::kNullObj 
)
static

This method is used to add new dag objects to the model.

If no parent node is specified, then the node is added under the world. When a node is added under the world, then a transform node is automatically created as a parent. This assumes that the node being added is not already a transform node. This method is only valid for dag nodes. If the specified object is not of type MFn::kDagNode then MS::kInvalidParameter will be returned.

Parameters
[in]objectobject to be added
[in]parentparent dag node (optional)
Returns
Status Code
Status Codes:
  • MS::kSuccess Object was successfully added
  • MS::kInvalidParameter Object or parent is invalid or object is already in the model
  • MS::kFailure Could not add object to model
MStatus addToModelAt ( MObject object,
const MVector point,
const double  scale[3] = NULL,
const double  rotation[3] = NULL,
MTransformationMatrix::RotationOrder  rotOrder = MTransformationMatrix::kXYZ 
)
static

Adds the specified dag object to the DAG and transform the object by the specified arguments.

This method is only valid for dag nodes. If the specified object is not of type MFn::kDagNode then MS::kInvalidParameter will be returned.

Parameters
[in]objectthe object to be added to the DAG
[in]pointtranslation vector
[in]scalescale amount
[in]rotationrotation amount
[in]rotOrderthe order of the rotation
Returns
Status Code
Status Codes:
  • MS::kSuccess Object was successfully added
  • MS::kInvalidParameter Object is not a DAG node
  • MS::kFailure Error adding the object to the DAG
MStatus removeFromModel ( MObject object)
static

Removes the specified dag node from the scene.

This method is only valid for dag nodes. If the specified object is not of type MFn::kDagNode then MS::kInvalidParameter will be returned.

Note that this method doesn't delete the dag node which means the node must be added back to scene by calling either MGlobal::addToModel() or MGlobal::addToModelAt() in later calls, otherwise the dag node is leaked. To delete the dag node, call MGlobal::deleteNode() instead.

Parameters
[in]objectdag node to be removed from the scene
Returns
Status Code
Status Codes:
  • MS::kSuccess node was successfully removed
  • MS::kInvalidParamter object is NULL, or is not a dag node, or has already been removed
  • MS::kFailure could not remove the node from the scene
MStatus deleteNode ( MObject object)
static

Delete the given dag node or dependency graph node.

Parameters
[in]objectnode to be deleted
Returns
Status Code
Status Codes:
  • MS::kSuccess node was successfully removed
  • MS::kInvalidParamter object is NULL, or is not a dependency node, or has already been deleted
  • MS::kFailure could not delete the node
Examples:
AbcImport/util.cpp, animImportExport/animFileUtils.cpp, atomImportExport/atomFileUtils.cpp, exampleCameraSetView/exampleCameraSetViewCmd.cpp, helixTool/helixTool.cpp, meshOpCmd/polyModifierCmd.cpp, and splitUVCmd/polyModifierCmd.cpp.
MStatus setYAxisUp ( bool  rotateView = false)
static

This method sets the flag to identify which axis is Up, and rotates the ground plane around around the X-axis 90 degrees to get the Y-Up from Z-Up.

Parameters
[in]rotateViewIf true then the viewing camera will be rotated
Returns
Status Code
Status Codes:
  • MS::kSuccess Up axis was correctly set
  • MS::kFailure Error setting the Up axis
MStatus setZAxisUp ( bool  rotateView = false)
static

This method sets the flag to identify which axis is Up, and rotates the ground plane around around the X-axis -90 degrees to get the Z-Up from Y-Up.

Parameters
[in]rotateViewIf true then the viewing camera will be rotated
Returns
Status Code
Status Codes:
  • MS::kSuccess Up axis was correctly set
  • MS::kFailure Error setting the Up axis
bool isYAxisUp ( MStatus ReturnStatus = NULL)
static

This method returns true if, currently, the Y-axis is UP.

Parameters
[in]ReturnStatus
Returns
Boolean value: true the Y-axis is Up, false otherwise.
Status Codes:
  • MS::kSuccess Method successfully returned
  • MS::kFailure Object error
bool isZAxisUp ( MStatus ReturnStatus = NULL)
static

This method returns true if, currently, the Z-axis is UP.

Parameters
[in]ReturnStatus
Returns
Boolean value: true the Z-axis is Up, false otherwise.
Status Codes:
  • MS::kSuccess Method successfully returned
  • MS::kFailure Object error
MVector upAxis ( MStatus ReturnStatus = NULL)
static

This method returns the model's current up axis.

Parameters
[in]ReturnStatus
Returns
The models up axis
Status Codes:
  • MS::kSuccess Method successfully returned
  • MS::kFailure Object error
Examples:
motionPathNode/motionPathNode.cpp.
void displayInfo ( const MString theMessage)
static

This method is used to display an informational message in the script editor.

This method is threadsafe, however for calls made outside of Maya's main thread the display of text will be deferred to the next idle cycle.

Parameters
[in]theMessageThe message string to be displayed
Examples:
AbcBullet/AbcBullet.cpp, AbcBullet/MayaTransformCollectionWriter.cpp, AbcBullet/MayaTransformWriter.cpp, AbcBullet/MayaUtility.h, AbcExport/AbcExport.cpp, AbcExport/MayaUtility.h, AbcImport/AbcImport.cpp, AbcImport/main.cpp, apiMeshShape/apiMeshGeometryOverride.cpp, blast2Cmd/blast2Cmd.cpp, cameraMessageCmd/cameraMessageCmd.cpp, cameraSetSubclass/testExCameraSetCmd.cpp, cgFx/cgfxShaderCmd.cpp, cgFx/cgfxShaderNode.cpp, cgFx/pluginMain.cpp, conditionTest/conditionTest.cpp, customSpriteShader/customSpriteShader.cpp, dagMessageCmd/dagMessageCmd.cpp, deletedMsgCmd/deletedMsgCmd.cpp, eventTest/eventTest.cpp, exampleCameraSetView/exampleCameraSetViewCmd.cpp, fileIOMsgCmd/fileIOMsgCmd.cpp, filteredAsciiFile/filteredAsciiFile.cpp, fluidInfoCmd/fluidInfoCmd.cpp, footPrintNode/footPrintNode.cpp, footPrintNode_GeometryOverride/footPrintNode_GeometryOverride.cpp, footPrintNode_GeometryOverride_AnimatedMaterial/footPrintNode_GeometryOverride_AnimatedMaterial.cpp, geometryCacheConverter/geometryCacheFile.cpp, gpuCache/gpuCacheCmd.cpp, hwApiTextureTest/hwApiTextureTest.cpp, instanceCallbackCmd/instanceCallbackCmd.cpp, instancerListCmd/instancerListCmd.cpp, intersectCmd/intersectCmd.cpp, listRichSelectionCmd/listRichSelectionCmd.cpp, maTranslator/maTranslator.cpp, narrowPolyViewer/narrowPolyViewer.cpp, narrowPolyViewer/narrowPolyViewerCmd.cpp, paintCallback/paintCallback.cpp, particleAttrNode/particleAttrNodeMain.cpp, particlePathsCmd/particlePathsCmd.cpp, particleSystemInfoCmd/particleSystemInfoCmd.cpp, pfxInfoCmd/pfxInfoCmd.cpp, polyRawExporter/polyExporter.cpp, polyRawExporter/polyRawWriter.cpp, polyX3DExporter/polyExporter.cpp, polyX3DExporter/polyX3DWriter.cpp, progressWindowCmd/progressWindowCmd.cpp, rawfootPrintNode/rawfootPrintNode.cpp, surfaceBumpManip/surfaceBumpManip.cpp, testCameraSetCmd/testCameraSetCmd.cpp, threadingLockTests/threadingLockTests.cpp, threadTestCmd/threadTestCmd.cpp, threadTestWithLocksCmd/threadTestWithLocksCmd.cpp, undoRedoMsgCmd/undoRedoMsgCmd.cpp, userMsgCmd/userMsgCmd.cpp, and viewDX11DeviceAccess/viewDX11DeviceAccess.cpp.
void displayWarning ( const MString theWarning)
static

This method is used to display a warning in the script editor.

This method is threadsafe, however for calls made outside of Maya's main thread the display of text will be deferred to the next idle cycle.

Parameters
[in]theWarningThe warning string to be displayed
Examples:
AbcBullet/AbcBullet.cpp, AbcBullet/AbcWriteJob.cpp, AbcBullet/AttributesWriter.cpp, AbcExport/AbcExport.cpp, AbcExport/AbcWriteJob.cpp, AbcExport/AttributesWriter.cpp, AbcExport/MayaMeshWriter.cpp, AbcExport/MayaNurbsCurveWriter.cpp, AbcImport/AlembicNode.cpp, AbcImport/CameraHelper.cpp, AbcImport/MeshHelper.cpp, AbcImport/util.h, animImportExport/animFileUtils.cpp, atomImportExport/atomFileUtils.cpp, cameraMessageCmd/cameraMessageCmd.cpp, cgFx/cgfxAttrDef.cpp, cgFx/cgfxEffectDef.cpp, cgFx/cgfxPassStateSetter.cpp, cgFx/cgfxProfile.cpp, cgFx/cgfxShaderCmd.cpp, cgFx/cgfxShaderNode.cpp, componentScaleManip/componentScaleManip.cpp, conditionTest/conditionTest.cpp, deletedMsgCmd/deletedMsgCmd.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderPluginMain.cpp, eventTest/eventTest.cpp, geometryOverrideExample1/geometryOverrideExample1.cpp, geometryOverrideExample2/geometryOverrideExample2.cpp, glslShader/GLSLShaderMainMaya.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheShapeNode.cpp, hlslShader/hlslShader.cpp, hwApiTextureTest/hwApiTextureTest.cpp, hwApiTextureTest/hwRendererHelper.cpp, hwApiTextureTest/hwRendererHelperDX.cpp, lassoTool/lassoTool.cpp, maTranslator/maTranslator.cpp, moveManip/moveManip.cpp, rawfootPrintNode/rawfootPrintNode.cpp, rotateManip/rotateManip.cpp, sceneAssembly/sceneAssemblyPluginMain.cpp, skinClusterWeights/skinClusterWeights.cpp, surfaceBumpManip/surfaceBumpManip.cpp, and viewRenderOverridePostColor/viewRenderOverridePostColorCmd.cpp.
void displayError ( const MString theError)
static

This method is used to display an error in the script editor.

This method is threadsafe, however for calls made outside of Maya's main thread the display of text will be deferred to the next idle cycle.

Parameters
[in]theErrorThe error string to be displayed
Examples:
AbcBullet/AbcBullet.cpp, AbcBullet/AttributesWriter.cpp, AbcBullet/MayaUtility.cpp, AbcExport/AbcExport.cpp, AbcExport/AbcWriteJob.cpp, AbcExport/AttributesWriter.cpp, AbcExport/MayaCameraWriter.cpp, AbcExport/MayaLocatorWriter.cpp, AbcExport/MayaMeshWriter.cpp, AbcExport/MayaNurbsSurfaceWriter.cpp, AbcExport/MayaUtility.cpp, AbcImport/NurbsSurfaceHelper.cpp, AbcImport/util.cpp, AbcImport/util.h, animImportExport/animFileUtils.cpp, animImportExport/animImportExport.cpp, atomImportExport/atomAnimLayers.cpp, atomImportExport/atomFileUtils.cpp, atomImportExport/atomImportExport.cpp, blast2Cmd/blast2Cmd.cpp, cameraSetSubclass/testExCameraSetCmd.cpp, captureViewRenderCmd/captureViewRenderCmd.cpp, cgFx/cgfxAttrDef.cpp, cgFx/cgfxEffectDef.cpp, cgFx/cgfxPassStateSetter.cpp, cgFx/cgfxShaderCmd.cpp, cgFx/cgfxShaderNode.cpp, cgFx/pluginMain.cpp, closestPointCmd/closestPointCmd.cpp, componentScaleManip/componentScaleManip.cpp, customSpriteShader/customSpriteShader.cpp, dagMessageCmd/dagMessageCmd.cpp, dx11Shader/dx11Shader.cpp, exampleCameraSetView/exampleCameraSetViewCmd.cpp, fluidInfoCmd/fluidInfoCmd.cpp, geometryCacheConverter/geometryCacheConverter.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.cpp, glslShader/GLSLShader.cpp, gpuCache/CacheWriterAlembic.cpp, helixQtCmd.cpp, hlslShader/hlslShader.cpp, instancerListCmd/instancerListCmd.cpp, intersectCmd/intersectCmd.cpp, lensDistortionCallback/lensDistortionCallback.cpp, lockEvent/lockEvent.cpp, maTranslator/maTranslator.cpp, MayaPluginForSpreticle/spReticleLoc.cpp, moveManip/moveManip.cpp, nameFilter/NameFilter.cpp, narrowPolyViewer/narrowPolyViewer.cpp, narrowPolyViewer/narrowPolyViewerCmd.cpp, nodeCreatedCBCmd/nodeCreatedCBCmd.cpp, nodeIconCmd/nodeIconCmd.cpp, paintCallback/paintCallback.cpp, particlePathsCmd/particlePathsCmd.cpp, particleSystemInfoCmd/particleSystemInfoCmd.cpp, peltOverlapCmd/peltOverlapCmd.cpp, pfxInfoCmd/pfxInfoCmd.cpp, pointOnSubdNode/pointOnSubdNode.cpp, polyRawExporter/polyExporter.cpp, polyRawExporter/polyRawWriter.cpp, polyRawExporter/polyWriter.cpp, polyX3DExporter/polyExporter.cpp, polyX3DExporter/polyWriter.cpp, polyX3DExporter/polyX3DWriter.cpp, progressWindowCmd/progressWindowCmd.cpp, qtForms.cpp, rockingTransform/rockingTransform.cpp, rockingTransformCheck/rockingTransform.cpp, rotateManip/rotateManip.cpp, saveSwatchesCmd.cpp, sceneAssembly/adskRepresentations.cpp, sceneAssembly/assemblyReference.cpp, sceneAssembly/sceneAssemblyPluginMain.cpp, skinClusterWeights/skinClusterWeights.cpp, squareScaleManipContext/squareScaleManipContext.cpp, surfaceBumpManip/surfaceBumpManip.cpp, testCameraSetCmd/testCameraSetCmd.cpp, threadingLockTests/threadingLockTests.cpp, threadTestCmd/threadTestCmd.cpp, threadTestWithLocksCmd/threadTestWithLocksCmd.cpp, viewRenderOverridePostColor/viewRenderOverridePostColorCmd.cpp, and workspaceControlCmd.cpp.
void setDisableStow ( bool  state)
static

This method is used to make the visiblity of all Maya windows unchangable.

If set to true, it disables any attempts to change the visiblity of any window. In addition, all popup windows will be supressed.

Parameters
[in]statetrue or false
bool disableStow ( )
static

This method is used to query if the disabling of Stowing (hiding) and Unstowing (showing) windows is active.

Returns
true if Stow is disabled, false if Stow is operating normally
int optionVarIntValue ( const MString name,
bool *  exists = NULL 
)
static

This method is used to get the option variable value of int type.

Parameters
[in]nameoption variable name
[out]existstrue if variable exists, false otherwise
Returns
Value of the variable as an integer.
Examples:
gpuCache/gpuCacheConfig.cpp, hwPhongShader/hwPhongShader.cpp, sceneAssembly/adskRepresentations.cpp, sceneAssembly/assemblyReference.cpp, and viewImageBlitOverride/viewImageBlitOverride.cpp.
double optionVarDoubleValue ( const MString name,
bool *  exists = NULL 
)
static

This method is used to get the option variable value of type double.

Parameters
[in]nameoption variable name
[out]existstrue if variable exists, false otherwise
Returns
Value of the variable as a double.
MString optionVarStringValue ( const MString name,
bool *  exists = NULL 
)
static

This method is used to get the option variable value of type string.

Parameters
[in]nameoption variable name
[out]existstrue if variable exists, false otherwise
Returns
Value of the variable as a string.
bool setOptionVarValue ( const MString name,
int  value 
)
static

This method is used to set the option variable value of int type.

Parameters
[in]nameoption variable name
[in]valueoption variable value to set
Returns
true
Examples:
gpuCache/gpuCacheConfig.cpp.
bool setOptionVarValue ( const MString optionVarName,
double  value 
)
static

This method is used to set the option variable value of type double.

Parameters
[in]optionVarNameoption variable name
[in]valueoption variable value to set
Returns
true
bool setOptionVarValue ( const MString name,
MString  value 
)
static

This method is used to set the option variable value of type string.

Parameters
[in]nameoption variable name
[in]valueoption variable value to set
Returns
true
void removeOptionVar ( const MString name)
static

This method is used to remove the option variable.

Parameters
[in]nameoption variable name
bool optionVarExists ( const MString name)
static

This method is used to check if the option variable exists.

Parameters
[in]nameoption variable name
Returns
true if option variable exists
MString defaultErrorLogPathName ( MStatus ReturnStatus = NULL)
static

Determines the default path name of the error log file.

Returns an empty string on failure.

Parameters
[out]ReturnStatusStatus code
Returns
Default path name
Status Codes:
  • kSuccess Default path name is valid
  • kFailure Could not determine default path name - could not access error log handler
MStatus resetToDefaultErrorLogPathName ( )
static

Closes the current log file if it is open, and then resets the log path to the default path.

Logging is disabled and the log file speicified by the default path is not opened. If logging is disabled, it remains disabled. Use startErrorLogging() to enable logging to the default log file. If the current path is the default path, no action is taken, but an invalid parameter error is returned.

Note that if the default log is reopened after it is closed, all information previously logged to it is lost.

Returns
Status Code
Status Codes:
  • MS::kSuccess Log file set at default path
  • MS::kInvalidParameter Current path is default path
  • MS::kFailure Status of log unknown - could not access log handler, could not close previously open log, or failed to set path name
MStatus setErrorLogPathName ( const MString logPathName)
static

Closes the current log file if it is open, and then sets the log path to the given path.

If logging is enabled, it remains enabled, but on the log file speicified by the new path. If logging is disabled, it remains disabled. Use startErrorLogging() to enable logging to the new file. If the given path name is the same as the current path name, no action is taken, but an invalid parameter error is returned.

Parameters
[in]logPathNamePath of the new error log file
Returns
Status Code
Status Codes:
  • MS::kSuccess Log file set at path
  • MS::kInvalidParameter New path name is the same as current path name
  • MS::kFailure Could not set log file at path - could not access log handler, or failed to set path name
MString errorLogPathName ( MStatus ReturnStatus = NULL)
static

Determines the path name of the current error log file.

Returns the null string on failure.

Parameters
[out]ReturnStatusStatus Code (see below)
Returns
Error log path name
Status Codes:
  • MS::kSuccess Path name is valid
  • MS::kFailure Could not determine path name - could not access error log handler
MStatus startErrorLogging ( )
static

This method enables output to the API error log.

If no log is currently open, a log file is opened at the current path. The error log is time and date stamped when it is opened. If output is already enabled, then no action is taken.

Returns
Status Code
Status Codes:
  • MS::kSuccess Output to API error log is enabled
  • MS::kFailure Could not enable output to API error log - could not access error log handler or could not start log.
MStatus startErrorLogging ( const MString logPathName)
static

This method enables output to the API error log file specified by the path.

If another error log file is already open this method time and date stamps the log, and closes it. The new error log is time and date stamped when it is opened.

If the new path name is the same as the current path name, this method ensures that logging is enabled, but no other action is taken.

Parameters
[in]logPathNamePath of the error log file
Returns
Status Code
Status Codes:
  • MS::kSuccess Output to API error log is enabled
  • MS::kFailure Could not enable output to API error log - could not set path name, could not access error log handler, or could not start log
bool errorLoggingIsOn ( MStatus ReturnStatus = NULL)
static

This method determines whether or not API errors are being logged.

Parameters
[out]ReturnStatusStatus Code (see below)
Returns
Boolean value: true Errors are being logged false otherwise.
Status Codes:
  • MS::kSuccess Return is valid
  • MS::kFailure Could not determine state of log - could not access error log handler
MStatus stopErrorLogging ( )
static

This method disables output to the API error log but does not close the log file.

Returns
Status Code
Status Codes:
  • MS::kSuccess Output to API error log is disabled
  • MS::kFailure Status of log unknown - could not access error log handler
MStatus closeErrorLog ( )
static

This method closes the API error log file.

If error logging is currently enabled this method disables it. The error log is time and date stamped before it is closed. After the log is closed the error log path name is reset to the default path name. If the error log file is already closed, then no action is taken.

Note that if a log is reopened after it is closed, all information previously logged to it is lost.

Returns
Status Code
Status Codes:
  • MS::kSuccess Error log file closed
  • MS::kFailure Log state not known - could not access error log handler, or error occurred when attempting to close file
MStatus doErrorLogEntry ( const MString errorLogEntry)
static

Logs an entry in the currently open log file.

It is not necessary for error logging to be enabled, but a log file must be open. A newline is appended to each log entry.

Parameters
[in]errorLogEntryInformation to log to file
Returns
Status Code
Status Codes:
  • MS::kSuccess Log entry successful
  • MS::kFailure Log entry failed could not access error log handler, or log not open
bool isUndoing ( )
static

Returns true if Maya is currently in the middle of an undo.

Returns
Boolean value: true if Maya is undoing, false otherwise.
bool isRedoing ( )
static

Returns true if Maya is currently in the middle of an redo.

Returns
Boolean value: true if Maya is redoing, false otherwise.
const char * className ( )
static

Returns the name of this class.

Returns
The name of this class.
bool getOptionVarValue ( const MString name,
int &  value 
)
static

This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
Use MGlobal::optionVarIntValue instead.
Deprecated:
Use MGlobal::optionVarIntValue instead.
Parameters
[in]name
[out]value
bool getOptionVarValue ( const MString name,
double &  value 
)
static

This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
Use MGlobal::optionVarDoubleValue instead.
Deprecated:
Use MGlobal::optionVarDoubleValue instead.
Parameters
[in]name
[out]value
bool getOptionVarValue ( const MString name,
MString value 
)
static

This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
Use MGlobal::optionVarStringValue instead.
Deprecated:
Use MGlobal::optionVarStringValue instead.
Parameters
[in]name
[out]value
MStatus select ( MDagPath object,
const MObject component,
MGlobal::ListAdjustment  listAdjustment = kAddToList 
)
static

This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
Use the version of MGlobal::select which takes a constant reference
Deprecated:
Use the version of MGlobal::select which takes a constant reference to an MDagPath as its first parameter.
Parameters
[in]object
[in]component
[in]listAdjustment
MStatus unselect ( MDagPath object,
const MObject component 
)
static

This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
Use the version of MGlobal::unselect which takes a constant reference to an MDagPath as its first parameter.
Deprecated:
Use the version of MGlobal::unselect which takes a constant reference to an MDagPath as its first parameter.
Parameters
[in]object
[in]component

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