class MGlobal

Jump to documentation

Static class providing common API global functions. (OpenMaya) (OpenMaya.py)

public members:

static MString mayaVersion ()
static int apiVersion ()
enum MMayaState
kInteractive
running with a UI
kBatch
running without a UI
kLibraryApp
A standalone (MLibrary) application is running
kBaseUIMode
Running in baseUI mode
static MMayaState mayaState ( MStatus * ReturnStatus = NULL )
static MStatus getFunctionSetList ( MObject forObject, MStringArray & array )
static MStatus getAssociatedSets ( MSelectionList & list, MObjectArray & setArray )
static MStatus getSelectionListByName ( const MString & name, MSelectionList &list )
enum ListAdjustment
kReplaceList
kXORWithList
kAddToList
kRemoveFromList
static MStatus getActiveSelectionList ( MSelectionList & dest )
static MStatus getLiveList ( MSelectionList & dest )
static MStatus getHiliteList ( MSelectionList & dest )
static MStatus setHiliteList ( MSelectionList & src )
static MStatus setActiveSelectionList ( MSelectionList & src, ListAdjustment = kReplaceList )
static MStatus setDisplayCVs ( MSelectionList &, bool )
static MStatus selectCommand ( MSelectionList & src, ListAdjustment = kReplaceList )
static MStatus selectByName ( const MString & name, ListAdjustment = kAddToList )
static MStatus unselectByName ( const MString & name )
static MStatus select ( MObject & object, ListAdjustment = kAddToList )
static MStatus select ( MDagPath & object, MObject & component, ListAdjustment = kAddToList )
static MStatus unselect ( MObject & object )
static MStatus unselect ( MDagPath & object, MObject & component )
static MStatus selectFromScreen ( short& x_pos, short& y_pos, ListAdjustment = kAddToList )
static MStatus selectFromScreen ( short& start_x, short& start_y, short& end_x, short& end_y, ListAdjustment = kAddToList )
enum MSelectionMode
kSelectObjectMode
kSelectComponentMode
kSelectRootMode
kSelectLeafMode
kSelectTemplateMode
static MSelectionMode selectionMode ( MStatus * ReturnStatus = NULL )
static MStatus setSelectionMode ( MSelectionMode mode )
static MSelectionMask objectSelectionMask ( MStatus * ReturnStatus = NULL )
static MStatus setObjectSelectionMask ( MSelectionMask & mask )
static MSelectionMask componentSelectionMask ( MStatus * ReturnStatus = NULL )
static MStatus setComponentSelectionMask ( MSelectionMask & mask )
static MSelectionMask animSelectionMask ( MStatus * ReturnStatus = NULL )
static MStatus setAnimSelectionMask ( MSelectionMask & mask )
static MSelectionMask miscSelectionMask ( MStatus * ReturnStatus = NULL )
static MStatus setMiscSelectionMask ( MSelectionMask & mask )
static MStatus clearSelectionList ()
static bool isSelected ( MObject & object, MStatus * ReturnStatus = NULL )
static MStatus viewFrame ( const MTime & time )
static MStatus viewFrame ( double time)
static MStatus sourceFile ( const MString & fileName )
static MStatus executeCommandOnIdle ( const MString & command, bool displayEnabled = false)
static MStatus executeCommand ( const MString & command, bool displayEnabled = false, bool undoEnabled = false)
static MStatus executeCommand ( const MString & command, MCommandResult & result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executeCommand ( const MString & command, int& result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executeCommand ( const MString & command, MIntArray & result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executeCommand ( const MString & command, double& result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executeCommand ( const MString & command, MDoubleArray & result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executeCommand ( const MString & command, MString & result, bool displayEnabled = false, bool undoEnabled = false )
NO SCRIPT SUPPORT
static MString executeCommandStringResult ( const MString & command, bool displayEnabled = false, bool undoEnabled = false, MStatus * ResultStatus = NULL)
static MStatus executeCommand ( const MString & command, MStringArray & result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executePythonCommand ( const MString & command, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executePythonCommand ( const MString & command, int& result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executePythonCommand ( const MString & command, MIntArray & result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executePythonCommand ( const MString & command, double& result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executePythonCommand ( const MString & command, MDoubleArray & result, bool displayEnabled = false, bool undoEnabled = false )
static MString executePythonCommandStringResult ( const MString & command, bool displayEnabled = false, bool undoEnabled = false, MStatus * ReturnStatus = NULL)
NO SCRIPT SUPPORT
static MStatus executePythonCommand ( const MString & command, MString & result, bool displayEnabled = false, bool undoEnabled = false )
NO SCRIPT SUPPORT
static MStatus executePythonCommand ( const MString & command, MStringArray & result, bool displayEnabled = false, bool undoEnabled = false )
static MStatus executePythonCommandOnIdle ( const MString & command, bool displayEnabled = false)
static MStatus addToModel ( MObject & object, MObject & parent = MObject::kNullObj )
static MStatus addToModelAt ( MObject &, const MVector & point, const double scale[3] = NULL, const double rotation[3] = NULL, MTransformationMatrix::RotationOrder order = MTransformationMatrix::kXYZ )
static MStatus removeFromModel ( MObject & )
static MStatus deleteNode ( MObject & )
static MStatus setYAxisUp ( bool rotateView = false )
static MStatus setZAxisUp ( bool rotateView = false )
static bool isYAxisUp ( MStatus * = NULL )
static bool isZAxisUp ( MStatus * = NULL )
static MVector upAxis ( MStatus * = NULL )
static void displayInfo ( const MString & theMessage )
static void displayWarning ( const MString & theWarning )
static void displayError ( const MString & theError )
static void setDisableStow ( bool state )
static bool disableStow ( )
static int optionVarIntValue (const MString & name, bool *result = NULL )
setting & getting option variable values
static double optionVarDoubleValue (const MString & name, bool *result = NULL)
static MString optionVarStringValue (const MString & name, bool *result = NULL)
static bool setOptionVarValue (const MString & name, int value)
static bool setOptionVarValue (const MString & name, double value)
static bool setOptionVarValue (const MString & name, MString value)
static MString defaultErrorLogPathName ( MStatus * ReturnStatus = NULL )
static MStatus resetToDefaultErrorLogPathName ()
static MStatus setErrorLogPathName ( const MString & logPathName )
static MString errorLogPathName ( MStatus * ReturnStatus = NULL )
static MStatus startErrorLogging ()
static MStatus startErrorLogging ( const MString & logPathName )
static bool errorLoggingIsOn ( MStatus * ReturnStatus = NULL )
static MStatus stopErrorLogging ()
static MStatus closeErrorLog ()
static MStatus doErrorLogEntry ( const MString & errorLogEntry )
static bool isUndoing ()
static bool isRedoing ()
static bool getOptionVarValue (const MString & name, int& value)
OBSOLETE & NO SCRIPT SUPPORT
static bool getOptionVarValue (const MString & name, double& value)
OBSOLETE & NO SCRIPT SUPPORT
static bool getOptionVarValue (const MString & name, MString & value)
OBSOLETE & NO SCRIPT SUPPORT

Documentation

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

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.

Functions

MString MGlobal:: mayaVersion ()

Description

Returns a string describing this version of Maya.

Return Value

  • The version string

int MGlobal:: apiVersion ()

Description

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

Return Value

  • The current API version

MGlobal::MMayaState MGlobal:: mayaState ( MStatus * ReturnStatus )

Description

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

Return Value

  • MGlobal::kInteractive Running with a UI
  • MGlobal::kBatch Running without a UI

Status Codes

  • MS::kSuccess Method was successful
  • MS::kFailure Object error

MStatus MGlobal:: getActiveSelectionList ( MSelectionList & dest )

Description

Returns a copy of the active selection list.

Arguments

  • dest Storage for the selection list

Return Value

  • Status code

Status Codes

  • MS::kSuccess Active selection list was successfully returned
  • MS::kFailure Error getting the active selection list

MStatus MGlobal:: getLiveList ( MSelectionList & dest )

Description

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.

Arguments

  • dest Storage for the selection list

Return Value

  • Status code

Status Codes

  • MS::kSuccess Live list was successfully returned
  • MS::kFailure Error getting the live list

MStatus MGlobal:: getHiliteList ( MSelectionList & dest )

Description

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.)

Arguments

  • dest Storage for the hilite list

Return Value

  • Status code

Status Codes

  • MS::kSuccess Hilite list was successfully returned
  • MS::kFailure Error getting the hilite list

MStatus MGlobal:: setHiliteList ( MSelectionList & list )

Description

Sets the current hilite list. The current selection list is unchanged.

Arguments

  • dest The new hilite list.

Return Value

  • Status code

Status Codes

  • MS::kSuccess Hilite list was successfully set
  • MS::kFailure Error setting the hilite list

MStatus MGlobal:: setActiveSelectionList ( MSelectionList & src, MGlobal::ListAdjustment listAdjustment)

Description

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.

Arguments

  • src The source list
  • listAdjustment Determines 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

Return Value

  • Status code

Status Codes

  • MS::kSuccess Active selection list was successfully set
  • MS::kFailure Error setting the active selection list

MStatus MGlobal:: setDisplayCVs ( MSelectionList & src, bool state )

Description

Controls drawing of control points in the specified selection list.

The selection items on the given list 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.

Arguments

  • src The source list
  • state Whether items should be marked on/off for drawing

Return Value

  • Status code

Status Codes

  • MS::kSuccess Selection list was successfully set
  • MS::kFailure Could not change the display of the selection list

MStatus MGlobal:: selectCommand ( MSelectionList & src, MGlobal::ListAdjustment listAdjustment)

Description

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.

Arguments

  • src The source list
  • listAdjustment Determines 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

Return Value

  • Status code

Status Codes

  • MS::kSuccess Active selection list was successfully set
  • MS::kFailure Error setting the active selection list

MStatus MGlobal:: getFunctionSetList ( MObject forObject, MStringArray & array )
Description

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.

Arguments

  • forObject object to get list of function sets for
  • array storage for the array of strings

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful

MStatus MGlobal:: getAssociatedSets ( MSelectionList & list, MObjectArray & setArray )
Description

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

Arguments

  • list items to finds sets for
  • setArray storage for the array of sets

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure An error occurred while getting the sets

MStatus MGlobal:: getSelectionListByName ( const MString &name, MSelectionList &list )

Description

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()
    {
        MSelectionList sList;
        MString toMatch ("pCube*|pCubeShape*");
        MGlobal::getSelectionListByName(toMatch, sList);

        unsigned int ii = 0;
        unsigned int nMatches = sList.length();
        for (ii = 0; ii < nMatches; ++ii) {
            MDagPath dp;
            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

Arguments

  • name Regular expression to match object name.
  • list Selection list into which the objects matching the name will be placed.

Return Value

  • Status code

Status Codes

  • MS::kSuccess Objects matching the name were successfully found
  • MS::kFailure Error getting the objects.

MStatus MGlobal:: selectByName ( const MString & name, MGlobal::ListAdjustment listAdjustment )
Description

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

Arguments

  • name Regular expression to match object name.
  • listAdjustment Determines 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

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection

MStatus MGlobal:: unselectByName ( const MString & name )
Description

Removes objects matching the pattern from the active selection list.

Arguments

  • name Regular expression to match object name.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection

MStatus MGlobal:: select ( MObject & object, MGlobal::ListAdjustment listAdjustment )
Description

Put the given object on the active selection list.

Arguments

  • object Object to make selected.
  • listAdjustment Determines 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

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
  • MS::kInvalidParameter Invalid object specified

MStatus MGlobal:: select ( MDagPath & object, MObject & component, MGlobal::ListAdjustment listAdjustment )
Description

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.

Arguments

  • object Object to make selected.
  • component Components to select.
  • listAdjustment Determines 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

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection

MStatus MGlobal:: unselect ( MObject & object )
Description

Remove the given object from the active selection list.

Arguments

  • object Object to unselect.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection
  • MS::kInvalidParameter Invalid object specified

MStatus MGlobal:: unselect ( MDagPath & object, MObject & component )
Description

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.

Arguments

  • object Object to unselect.
  • components Components to be unselected.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection

MStatus MGlobal:: selectFromScreen ( short& x_pos, short& y_pos, MGlobal::ListAdjustment listAdjustment )
Description

Perform click-pick type selection on the dag. If an object intersects the click point then it is selected according to listAdjustment.

Arguments

  • x_pos X position on screen to select at.
  • y_pos Y position on screen to select at.
  • listAdjustment Determines 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

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection

MStatus MGlobal:: selectFromScreen ( short & start_x, short & start_y, short & end_x, short & end_y, MGlobal::ListAdjustment listAdjustment )
Description

Perform marquee type selection on the dag. If an object intersects the selection rectangle, it is selected according to listAdjustment.

Arguments

  • start_x Start x position of selection rectangle
  • start_y Start y position of selection rectangle
  • end_x End x position of selection rectangle
  • end_y End y position of selection rectangle
  • listAdjustment Determines 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

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection was successful
  • MS::kFailure Error in selection

MGlobal::MSelectionMode MGlobal:: selectionMode ( MStatus * ReturnStatus )
Description

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.

Arguments

  • ReturnStatus

Return Value

  • The selection mode.

Status Codes

  • MS::kSuccess Method successfully returned a result
  • MS::kFailure Error in getting active model

MStatus MGlobal:: setSelectionMode ( MGlobal::MSelectionMode mode )
Description

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.

Arguments

  • mode The mode to be set

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection mode is set
  • MS::kFailure Error setting selection mode

MSelectionMask MGlobal:: objectSelectionMask ( MStatus * ReturnStatus )
Description

Returns the object selection mask.

Arguments

  • ReturnStatus

Return Value

  • The selection mask

Status Codes

  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask

MStatus MGlobal:: setObjectSelectionMask ( MSelectionMask & mask )
Description

Set the object selection mask to the supplied value

Arguments

  • mask The mask to set to

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask

MSelectionMask MGlobal:: componentSelectionMask ( MStatus * ReturnStatus )
Description

Returns the component selection mask.

Arguments

  • ReturnStatus

Return Value

  • The component selection mask

Status Codes

  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask

MStatus MGlobal:: setComponentSelectionMask ( MSelectionMask & mask )
Description

Set the component selection mask to the supplied value

Arguments

  • mask The mask to be set

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask

MSelectionMask MGlobal:: animSelectionMask ( MStatus * ReturnStatus )
Description

Returns the animation selection mask.

Arguments

  • ReturnStatus

Return Value

  • The selection mask

Status Codes

  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask

MStatus MGlobal:: setAnimSelectionMask ( MSelectionMask & mask )
Description

Set the animation selection mask to the supplied value

Arguments

  • mask The mask to be set

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask

MSelectionMask MGlobal:: miscSelectionMask ( MStatus * ReturnStatus )
Description

Returns the miscellaneous selection mask.

Arguments

  • ReturnStatus

Return Value

  • The selection mask

Status Codes

  • MS::kSuccess Selection mask successfully retrieved
  • MS::kFailure Error getting the selection mask

MStatus MGlobal:: setMiscSelectionMask ( MSelectionMask & mask )
Description

Set the miscellaneous selection mask to the supplied value

Arguments

  • mask The mask to be set

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Selection mask successfully set
  • MS::kFailure Error setting selection mask

MStatus MGlobal:: clearSelectionList ()
Description

Removes all items from the active selection list.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Active selection list was successfully cleared.
  • MS::kFailure Error clearing the active selection list.

bool MGlobal:: isSelected ( MObject & object, MStatus * ReturnStatus )
Description

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

Note: The given object must be a dependency node.

Arguments

  • object Dependency node object to test.
  • ReturnStatus

Return Value

  • true - object is selected
  • false - object is not selected

Status Codes

  • kSuccess Method successfully returned a result
  • kInvalidParameter A null MObject was provided
  • kFailure Error doing test

MStatus MGlobal:: viewFrame ( const MTime & time )
Description

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.

Arguments

  • time Time to set.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess global time set was successful
  • MS::kFailure Error setting view time

MStatus MGlobal:: viewFrame ( double time )
Description

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.

Arguments

  • time Time to set, in the units currently in effect for the user interface.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess global time set was successful
  • MS::kFailure Error setting view time

MStatus MGlobal:: sourceFile ( const MString & fileName )
Description

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.

Arguments

  • fileName The name of a file containing MEL commands

Return Value

  • Status Code

Status Codes

  • MS::kSuccess the contents of the file executed successfully
  • MS::kFailure the contents of the file was not successfully executed.

MStatus MGlobal:: executeCommandOnIdle ( const MString & command, bool displayEnabled)
Description

Sets a MEL 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.

Arguments

  • command The MEL command string to add to idle queue.
  • displayEnabled Flag to enable display of command in journal window - defaults to false

Return Value

  • Status Code

Status Codes

  • MS::kSuccess MEL command was successfully added to idle queue
  • MS::kFailure Error adding MEL command to idle queue

MStatus MGlobal:: executeCommand ( const MString & command, bool displayEnabled, bool undoEnabled )
Description

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.

Arguments

  • command The MEL command string to execute.
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Status Code

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executeCommand ( const MString & command, MCommandResult & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The MEL command string to execute
  • result The command result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Status Code

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executeCommand ( const MString & command, int& result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The MEL command string to execute
  • result The integer result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Integer return from command

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executeCommand ( const MString & command, MIntArray & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The MEL command string to execute
  • result The MIntArray result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Integer array returned by command

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executeCommand ( const MString & command, double& result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The MEL command string to execute
  • result The double result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Double returned by command

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executeCommand ( const MString & command, MDoubleArray & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The MEL command string to execute
  • result The MDoubleArray result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Double array value returned from command

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executeCommand ( const MString & command, MString & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

Python Notes

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

  • command The MEL command string to execute
  • result The MString result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • String value returned by command

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MString MGlobal:: executeCommandStringResult ( const MString & command, bool displayEnabled, bool undoEnabled, MStatus * ReturnStatus)
Description

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. Arguments

  • command The MEL command string to execute
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false
  • ReturnStatus Optional return status. See below.

Return Value

  • String value returned by command

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executeCommand ( const MString & command, MStringArray & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The MEL command string to execute
  • result The MStringArray result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • String array value returned by command

Status Codes

  • MS::kSuccess MEL command was successfully executed
  • MS::kFailure Error executing MEL command

MStatus MGlobal:: executePythonCommand ( const MString & command, bool displayEnabled, bool undoEnabled )
Description

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.

Arguments

  • command The Python command string to execute.
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MStatus MGlobal:: executePythonCommand ( const MString & command, int& result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The Python command string to execute
  • result The integer result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Integer return from command

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MStatus MGlobal:: executePythonCommand ( const MString & command, MIntArray & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The Python command string to execute
  • result The integer array result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • Integer array returned from command

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MStatus MGlobal:: executePythonCommand ( const MString & command, double& result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The Python command string to execute
  • result The double result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • double returned from command

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MStatus MGlobal:: executePythonCommand ( const MString & command, MDoubleArray & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The Python command string to execute
  • result The double array result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • double array returned from command

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MStatus MGlobal:: executePythonCommand ( const MString & command, MString & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

Python Notes

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

  • command The Python command string to execute
  • result The string result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • string returned from command

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MString MGlobal:: executePythonCommandStringResult ( const MString & command, bool displayEnabled, bool undoEnabled, MStatus * ReturnStatus )
Description

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. Arguments

  • command The Python command string to execute
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false
  • ReturnStatus Optional return status. See below.

Return Value

  • string returned from command

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MStatus MGlobal:: executePythonCommand ( const MString & command, MStringArray & result, bool displayEnabled, bool undoEnabled )
Description

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. Arguments

  • command The Python command string to execute
  • result The string array result
  • displayEnabled Flag to enable display of command in journal window - defaults to false
  • undoEnabled Flag to enable addition of command to undo queue - defaults to false

Return Value

  • string array returned from command

Status Codes

  • MS::kSuccess Python command was successfully executed
  • MS::kFailure Error executing Python command

MStatus MGlobal:: executePythonCommandOnIdle ( const MString & command, bool displayEnabled)
Description

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.

Arguments

  • command The Python command string to add to idle queue.
  • displayEnabled Flag to enable display of command in journal window - defaults to false

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Python command was successfully added to idle queue
  • MS::kFailure Error adding Python command to idle queue

MStatus MGlobal:: addToModel ( MObject & object, MObject & parent )

Description

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.

Arguments

  • object object to be added
  • parent parent dag node (optional)

Return Value

  • 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 MGlobal:: addToModelAt ( MObject & object, const MVector & point, const double scale[3], const double rotation[3], MTransformationMatrix::RotationOrder rotOrder )

Description

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.

Arguments

  • object the object to be added to the DAG
  • point translation vector
  • scale scale amount
  • rotation rotation amount
  • RotationOrder the orger of the rotation

Return Value

  • 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 MGlobal:: removeFromModel ( MObject & object )

Description

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.

Arguments

  • object dag node to be removed from the scene

Return Value

  • 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 MGlobal:: deleteNode ( MObject & object )

Description

Delete the given dag node or dependency graph node.

Arguments

  • object node to be deleted

Return Value

  • Status Code

Status Codes

  • MS::kSuccess node was successfully removed
  • MS::kInvalidParamter object is NULL, or is not a depenency node, or has already been deleted
  • MS::kFailure could not delete the node

MStatus MGlobal:: setYAxisUp (bool rotateView )

Description

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.

Arguments

  • rotateView If true then the viewing camera will be rotated

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Up axis was correctly set
  • MS::kFailure Error setting the Up axis

MStatus MGlobal:: setZAxisUp ( bool rotateView )

Description

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.

Arguments

  • rotateView If true then the viewing camera will be rotated

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Up axis was correctly set
  • MS::kFailure Error setting the Up axis

bool MGlobal:: isYAxisUp ( MStatus * ReturnStatus)

Description

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

Arguments

  • ReturnStatus

Return Value

  • true the Y-axis is Up
  • false the Y-axis is NOT Up

Status Codes

  • MS::kSuccess Method successfully returned
  • MS::kFailure Object error

bool MGlobal:: isZAxisUp ( MStatus * ReturnStatus)

Description

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

Arguments

  • ReturnStatus

Return Value

  • true the Z-axis is Up
  • false the Z-axis is NOT Up

Status Codes

  • MS::kSuccess Method successfully returned
  • MS::kFailure Object error

MVector MGlobal:: upAxis ( MStatus * ReturnStatus)

Description

This method returns the model's current up axis.

Arguments

  • ReturnStatus

Return Value

  • The models up axis

Status Codes

  • MS::kSuccess Method successfully returned
  • MS::kFailure Object error

void MGlobal:: displayInfo ( const MString & theMessage )

Description

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

Arguments

  • theMessage The message string to be displayed

void MGlobal:: displayWarning ( const MString & theWarning )

Description

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

Arguments

  • theWarning The warning string to be displayed

void MGlobal:: displayError ( const MString & theError )

Description

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

Arguments

  • theError The error string to be displayed

void MGlobal:: setDisableStow ( bool state )

Description

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.

Arguments

  • state true or false

bool MGlobal:: disableStow ( )

Description

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

Arguments

  • Nil

Return Value

  • true if Stow is disabled, false if Stow is operating normally

bool MGlobal:: getOptionVarValue (const MString & name, int& value)

Description

This method is OBSOLETE and NON SCRIPTABLE. Please use optionVarIntValue() instead.

int MGlobal:: optionVarIntValue (const MString & name, bool *result)
Description

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

Arguments

  • name option variable name
  • value option variable value required to be accessed

Return Value

  • true if the variable exits , false if variable does not exist

bool MGlobal:: getOptionVarValue (const MString & name, double& value)

Description

This method is OBSOLETE and NON SCRIPTABLE. Please use optionVarDoubleValue() instead.

double MGlobal:: optionVarDoubleValue (const MString & name, bool *result)
Description

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

Arguments

  • name option variable name
  • value option variable value required to be accessed

Return Value

  • true if the variable exits , false if variable does not exist

bool MGlobal:: getOptionVarValue (const MString & name, MString & value)

Description

This method is OBSOLETE and NON SCRIPTABLE. Please use optionVarStringValue() instead.

MString MGlobal:: optionVarStringValue (const MString & name, bool *result)
Description

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

Arguments

  • name option variable name
  • value option variable value required to be accessed

Return Value

  • true if the variable exits , false if variable does not exist

bool MGlobal:: setOptionVarValue (const MString & name, int value)
Description

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

Arguments

  • name option variable name
  • value option variable value to set

Return Value

  • true

bool MGlobal:: setOptionVarValue (const MString & optionVarName, double value)
Description

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

Arguments

  • name option variable name
  • value option variable value to set

Return Value

  • true

bool MGlobal:: setOptionVarValue (const MString & name, MString value)
Description

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

Arguments

  • name option variable name
  • value option variable value to set

Return Value

  • true

MStatus MGlobal:: resetToDefaultErrorLogPathName ( )

Description

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.

Arguments

  • Nil

Return Value

  • Status Code (see below)

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

MString MGlobal:: defaultErrorLogPathName ( MStatus * ReturnStatus )

Description

Determines the default path name of the error log file. Returns the null string on failure.

Arguments

  • Nil

Return Value

  • 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 MGlobal:: setErrorLogPathName ( const MString & logPathName )

Description

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.

Arguments

  • logPathName Path of the new error log file

Return Value

  • Status Code (see below)

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 MGlobal:: errorLogPathName ( MStatus * ReturnStatus )

Description

Determines the path name of the current error log file. Returns the null string on failure.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • 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 MGlobal:: startErrorLogging ()

Description

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.

Arguments

  • Nil

Return Value

  • Status Code (see below)

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 MGlobal:: startErrorLogging ( const MString & logPathName )

Description

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.

Arguments

  • logFilePath Path of the error log file

Return Value

  • Status Code (see below)

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 MGlobal:: errorLoggingIsOn ( MStatus * ReturnStatus )

Description

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

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • true Errors are being logged
  • false Errors are not being logged

Status Codes

  • MS::kSuccess Return is valid
  • MS::kFailure Could not determine state of log - could not access error log handler

MStatus MGlobal:: stopErrorLogging ()

Description

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

Arguments

  • Nil

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Output to API error log is disabled
  • MS::kFailure Status of log unknown - could not access error log handler

MStatus MGlobal:: closeErrorLog ()

Description

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.

Arguments

  • Nil

Return Value

  • Status Code (see below)

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 MGlobal:: doErrorLogEntry ( const MString & errorLogEntry )

Description

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.

Arguments

  • logEntry Information to log to file

Return Value

  • Status Code (see below)

Status Codes

  • MS::kSuccess Log entry successful
  • MS::kFailure Log entry failed could not access error log handler, or log not open

bool MGlobal:: isUndoing ()

Description

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

Return Value

  • true - Maya is undoing
  • false - object is not undoing

bool MGlobal:: isRedoing ()

Description

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

Return Value

  • true - Maya is redoing
  • false - object is not redoing

This class has no child classes.


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