This reference page is linked to from the following overview topics: 重要なプラグイン機能, ラッパ, エラー ロギング, MGlobal::selectByName(), スレッドと Maya API.
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.
#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... |
|
Static Public Member Functions |
|
static MString | mayaVersion () |
Returns a string describing this version of
Maya. |
|
static int | apiVersion () |
Returns a number describing the version of
the Maya API at runtime. |
|
static MMayaState | mayaState (MStatus *ReturnStatus=NULL) |
Returns an enumerated type specifying the
way in which Maya was invoked. |
|
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. |
|
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. |
|
static MStatus | getSelectionListByName (const MString &name, MSelectionList &list) |
This method fills a selection list with all
of the objects that match a specified name. |
|
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. |
|
static MStatus | getRichSelection (MRichSelection &dest, bool defaultToActiveSelection=true) |
Returns the current rich selection (usually
the active selection with any soft selection and symmetry applied).
|
|
static MStatus | getLiveList (MSelectionList &dest) |
Returns a copy of the live list. |
|
static MStatus | getHiliteList (MSelectionList &dest) |
Returns a copy of the hilite list. |
|
static MStatus | setHiliteList (MSelectionList &src) |
Sets the current hilite list. |
|
static MStatus | setActiveSelectionList (const MSelectionList &src, ListAdjustment=kReplaceList) |
Set the active selection list. |
|
static MStatus | setDisplayCVs (MSelectionList &, bool) |
Controls drawing of control points in the
specified selection list. |
|
static MStatus | selectCommand (const MSelectionList &src, ListAdjustment=kReplaceList) |
Set the active selection list, by calling
the built in Maya select command. |
|
static MStatus | selectByName (const MString &name, ListAdjustment=kAddToList) |
Puts objects that match the give name on the
active selection list. |
|
static MStatus | unselectByName (const MString &name) |
Removes objects matching the pattern from
the active selection list. |
|
static MStatus | select (MObject &object, ListAdjustment=kAddToList) |
Put the given object on the active selection
list. |
|
static MStatus | select (const MDagPath &object, const MObject &component, ListAdjustment=kAddToList) |
Put the given object or components on the
active selection list. |
|
static MStatus | unselect (MObject &object) |
Remove the given object from the active
selection list. |
|
static MStatus | unselect (const MDagPath &object, const MObject &component) |
Remove the given object/components from the
active selection list. |
|
static MStatus | selectFromScreen (const short &x_pos, const short &y_pos, ListAdjustment=kAddToList, SelectionMethod=kWireframeSelectMethod) |
Perform click-pick type selection on the
dag. |
|
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.
|
|
static SelectionMethod | selectionMethod (MStatus *ReturnStatus=NULL) |
Determines the selection method that should
be used in the currently active viewport. |
|
static MSelectionMode | selectionMode (MStatus *ReturnStatus=NULL) |
Determines Maya's selection mode. |
|
static MStatus | setSelectionMode (MSelectionMode mode) |
Sets the selection mode. |
|
static MSelectionMask | objectSelectionMask (MStatus *ReturnStatus=NULL) |
Returns the object selection mask. |
|
static MStatus | setObjectSelectionMask (const MSelectionMask &mask) |
Set the object selection mask to the
supplied value. |
|
static MSelectionMask | componentSelectionMask (MStatus *ReturnStatus=NULL) |
Returns the component selection mask.
|
|
static MStatus | setComponentSelectionMask (const MSelectionMask &mask) |
Set the component selection mask to the
supplied value. |
|
static MSelectionMask | animSelectionMask (MStatus *ReturnStatus=NULL) |
Returns the animation selection mask.
|
|
static MStatus | setAnimSelectionMask (const MSelectionMask &mask) |
Set the animation selection mask to the
supplied value. |
|
static MSelectionMask | miscSelectionMask (MStatus *ReturnStatus=NULL) |
Returns the miscellaneous selection mask.
|
|
static MStatus | setMiscSelectionMask (const MSelectionMask &mask) |
Set the miscellaneous selection mask to the
supplied value. |
|
static MStatus | clearSelectionList () |
Removes all items from the active selection
list. |
|
static bool | isSelected (MObject &object, MStatus *ReturnStatus=NULL) |
Determines whether the given object is on
the active selection list. |
|
static bool | trackSelectionOrderEnabled (MStatus *ReturnStatus=NULL) |
Returns whether the selection order is
currerntly being tracked. |
|
static MStatus | setTrackSelectionOrderEnabled (bool enable) |
Set whether Maya should maintain an active
selection list which maintains object and component selection
order. |
|
static MStatus | viewFrame (const MTime &time) |
Sets the global time to the specified time.
|
|
static MStatus | viewFrame (double time) |
Sets the global time to the specified time.
|
|
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.
|
|
static MStatus | executeCommandOnIdle (const MString &command, bool displayEnabled=false) |
Sets a MEL command to execute on the next
idle event. |
|
static MStatus | executeCommand (const MString &command, bool displayEnabled=false, bool undoEnabled=false) |
Executes a MEL command with no access to
result. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
static MStatus | executeCommand (const MString &command, MString &result, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MStatus | executePythonCommand (const MString &command, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MStatus | executePythonCommand (const MString &command, int &result, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MStatus | executePythonCommand (const MString &command, MIntArray &result, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MStatus | executePythonCommand (const MString &command, double &result, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MStatus | executePythonCommand (const MString &command, MDoubleArray &result, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MString | executePythonCommandStringResult (const MString &command, bool displayEnabled=false, bool undoEnabled=false, MStatus *ReturnStatus=NULL) |
This method is not available in
Python. |
|
static MStatus | executePythonCommand (const MString &command, MString &result, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MStatus | executePythonCommand (const MString &command, MStringArray &result, bool displayEnabled=false, bool undoEnabled=false) |
This method is not available in
Python. |
|
static MStatus | executePythonCommandOnIdle (const MString &command, bool displayEnabled=false) |
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. |
|
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. |
|
static MStatus | removeFromModel (MObject &) |
Removes the specified dag node from the
scene. |
|
static MStatus | deleteNode (MObject &) |
Delete the given dag node or dependency
graph node. |
|
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. |
|
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. |
|
static bool | isYAxisUp (MStatus *=NULL) |
This method returns true if, currently, the
Y-axis is UP. |
|
static bool | isZAxisUp (MStatus *=NULL) |
This method returns true if, currently, the
Z-axis is UP. |
|
static MVector | upAxis (MStatus *=NULL) |
This method returns the model's current up
axis. |
|
static void | displayInfo (const MString &theMessage) |
This method is used to display an
informational message in the script editor. |
|
static void | displayWarning (const MString &theWarning) |
This method is used to display a warning in
the script editor. |
|
static void | displayError (const MString &theError) |
This method is used to display an error in
the script editor. |
|
static void | setDisableStow (bool state) |
This method is used to make the visiblity of
all Maya windows unchangable. |
|
static bool | disableStow () |
This method is used to query if the
disabling of Stowing (hiding) and Unstowing (showing) windows is
active. |
|
static int | optionVarIntValue (const MString &name, bool *exists=NULL) |
This method is used to get the option
variable value of int type. |
|
static double | optionVarDoubleValue (const MString &name, bool *exists=NULL) |
This method is used to get the option
variable value of type double. |
|
static MString | optionVarStringValue (const MString &name, bool *exists=NULL) |
This method is used to get the option
variable value of type string. |
|
static bool | setOptionVarValue (const MString &name, int value) |
This method is used to set the option
variable value of int type. |
|
static bool | setOptionVarValue (const MString &name, double value) |
This method is used to set the option
variable value of type double. |
|
static bool | setOptionVarValue (const MString &name, MString value) |
This method is used to set the option
variable value of type string. |
|
static MString | defaultErrorLogPathName (MStatus *ReturnStatus=NULL) |
Determines the default path name of the
error log file. |
|
static MStatus | resetToDefaultErrorLogPathName () |
Closes the current log file if it is open,
and then resets the log path to the default path. |
|
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. |
|
static MString | errorLogPathName (MStatus *ReturnStatus=NULL) |
Determines the path name of the current
error log file. |
|
static MStatus | startErrorLogging () |
This method enables output to the API error
log. |
|
static MStatus | startErrorLogging (const MString &logPathName) |
This method enables output to the API error
log file specified by the path. |
|
static bool | errorLoggingIsOn (MStatus *ReturnStatus=NULL) |
This method determines whether or not API
errors are being logged. |
|
static MStatus | stopErrorLogging () |
This method disables output to the API error
log but does not close the log file. |
|
static MStatus | closeErrorLog () |
This method closes the API error log file.
|
|
static MStatus | doErrorLogEntry (const MString &errorLogEntry) |
Logs an entry in the currently open log
file. |
|
static bool | isUndoing () |
Returns true if Maya is currently in the
middle of an undo. |
|
static bool | isRedoing () |
Returns true if Maya is currently in the
middle of an redo. |
|
static const char * | className () |
Returns the name of this class. |
|
static bool | getOptionVarValue (const MString &name, int &value) |
This method is obsolete. This
method is not available in Python. |
|
static bool | getOptionVarValue (const MString &name, double &value) |
This method is obsolete. This
method is not available in Python. |
|
static bool | getOptionVarValue (const MString &name, MString &value) |
This method is obsolete. This
method is not available in Python. |
|
static MStatus | select (MDagPath &object, const MObject &component, ListAdjustment=kAddToList) |
This method is obsolete. This
method is not available in Python. |
|
static MStatus | unselect (MDagPath &object, const MObject &component) |
This method is obsolete. This
method is not available in Python. |
enum MMayaState |
State in which Maya has been started.
kInteractive |
Running with a UI. |
kBatch |
Running without a UI. |
kLibraryApp |
A standalone (MLibrary) application is running. |
kBaseUIMode |
Running in baseUI mode. |
enum ListAdjustment |
Operations on selection lists.
enum SelectionMethod |
Choices for types of selection methods used in the selectFromScreen functions.
enum MSelectionMode |
Global selection modes.
MString mayaVersion | ( | ) | [static] |
Returns a string describing this version of Maya.
int apiVersion | ( | ) | [static] |
Returns a number describing the version of the Maya API at runtime.
MGlobal::MMayaState mayaState | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
Returns an enumerated type specifying the way in which Maya was invoked.
[out] | ReturnStatus | Status code. |
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.
[in] | forObject | object to get list of function sets for |
[out] | array | storage for the array of strings |
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.
[in] | list | items to finds sets for |
[out] | setArray | storage for the array of 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() { 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
[in] | name | Regular expression to match object name. |
[out] | list | Selection list into which the objects matching the name will be placed. |
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'.
[out] | dest | Storage for the selection list |
[in] | orderedSelectionIfAvailable | If true, and tracking is enabled, will return the selected items in the order that they were selected. |
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).
[out] | richSelection | Storage for the rich selection |
[in] | defaultToActiveSelection | If true, Maya will return the active selection when no rich selection exists. |
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.
[out] | dest | Storage for the selection 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.)
[out] | dest | Storage for the hilite list |
MStatus setHiliteList | ( | MSelectionList & | list | ) | [static] |
Sets the current hilite list.
The current selection list is unchanged.
[in] | list | The new 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.
[in] | src | The source list |
[in] | 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 kAddToHeadOfList - add the items to beginning of the 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.
[in] | src | The source list |
[in] | state | Whether items should be marked on/off for drawing |
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.
[in] | src | The source list |
[in] | 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 kAddToHeadOfList - add the items to beginning of the list |
MStatus selectByName | ( | const MString & | name, |
MGlobal::ListAdjustment | listAdjustment =
kAddToList |
||
) | [static] |
Puts objects that match the give name on the active selection list.
[in] | name | Regular expression to match object name. |
[in] | 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 kAddToHeadOfList - add the items to beginning of the list |
Removes objects matching the pattern from the active selection list.
[in] | name | Regular expression to match object name. |
MStatus select | ( | MObject & | object, |
MGlobal::ListAdjustment | listAdjustment =
kAddToList |
||
) | [static] |
Put the given object on the active selection list.
[in] | object | Object to make selected. |
[in] | 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 kAddToHeadOfList - add the items to beginning of the list |
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.
[in] | object | Object to make selected. |
[in] | component | Components to select. |
[in] | 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 kAddToHeadOfList - add the items to beginning of the list |
Remove the given object from the active selection list.
[in] | object | Object to unselect. |
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.
[in] | object | Object to unselect. |
[in] | component | Components to be unselected. |
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.
[in] | x_pos | X position on screen to select at. |
[in] | y_pos | Y position on screen to select at. |
[in] | 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 kAddToHeadOfList - add the items to beginning of the list |
[in] | selectMethod | Determines 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. |
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.
[in] | start_x | Start x position of selection rectangle |
[in] | start_y | Start y position of selection rectangle |
[in] | end_x | End x position of selection rectangle |
[in] | end_y | End y position of selection rectangle |
[in] | 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 kAddToHeadOfList - add the items to beginning of the list |
[in] | selectMethod | Determines 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. |
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.
[out] | ReturnStatus |
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.
[out] | ReturnStatus |
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.
[in] | mode | The mode to be set |
MSelectionMask objectSelectionMask | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
Returns the object selection mask.
[out] | ReturnStatus |
MStatus setObjectSelectionMask | ( | const MSelectionMask & | mask | ) | [static] |
Set the object selection mask to the supplied value.
[in] | mask | The mask to set to |
MSelectionMask componentSelectionMask | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
Returns the component selection mask.
[out] | ReturnStatus |
MStatus setComponentSelectionMask | ( | const MSelectionMask & | mask | ) | [static] |
Set the component selection mask to the supplied value.
[in] | mask | The mask to be set |
MSelectionMask animSelectionMask | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
Returns the animation selection mask.
[out] | ReturnStatus |
MStatus setAnimSelectionMask | ( | const MSelectionMask & | mask | ) | [static] |
Set the animation selection mask to the supplied value.
[in] | mask | The mask to be set |
MSelectionMask miscSelectionMask | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
Returns the miscellaneous selection mask.
[out] | ReturnStatus |
MStatus setMiscSelectionMask | ( | const MSelectionMask & | mask | ) | [static] |
Set the miscellaneous selection mask to the supplied value.
[in] | mask | The mask to be set |
MStatus clearSelectionList | ( | ) | [static] |
Removes all items from the active selection list.
Determines whether the given object is on the active selection list.
Note: The given object must be a dependency node.
[in] | object | Dependency node object to test. |
[out] | ReturnStatus |
bool trackSelectionOrderEnabled | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
Returns whether the selection order is currerntly being tracked.
[out] | ReturnStatus |
MStatus setTrackSelectionOrderEnabled | ( | bool | enable | ) | [static] |
Set whether Maya should maintain an active selection list which maintains object and component selection order.
[in] | enable | Flag to enable or disable the tracking of selection order. |
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.
[in] | time | Time to set. |
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.
[in] | time | Time to set, in the units currently in effect for the user interface. |
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.
[in] | fileName | The name of a file containing MEL commands |
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.
[in] | command | The MEL command string to add to idle queue. |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
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.
[in] | command | The MEL command string to execute. |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The MEL command string to execute |
[out] | result | The command result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The MEL command string to execute |
[out] | result | The integer result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The MEL command string to execute |
[out] | result | The MIntArray result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The MEL command string to execute |
[out] | result | The double result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The MEL command string to execute |
[out] | result | The MDoubleArray result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The MEL command string to execute |
[out] | result | The MStringArray result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The MEL command string to execute |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
[out] | ReturnStatus | Optional return status. See below. |
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.
[in] | command | The MEL command string to execute |
[out] | result | The MString result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to execute. |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to execute |
[out] | result | The integer result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to execute |
[out] | result | The integer array result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to execute |
[out] | result | The double result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to execute |
[out] | result | The double array result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to execute |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
[out] | ReturnStatus | Optional return status. See below. |
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.
[in] | command | The Python command string to execute |
[out] | result | The string result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to execute |
[out] | result | The string array result |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
[in] | undoEnabled | Flag to enable addition of command to undo queue - defaults to false |
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.
[in] | command | The Python command string to add to idle queue. |
[in] | displayEnabled | Flag to enable display of command in journal window - defaults to false |
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.
[in] | object | object to be added |
[in] | parent | parent dag node (optional) |
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.
[in] | object | the object to be added to the DAG |
[in] | point | translation vector |
[in] | scale | scale amount |
[in] | rotation | rotation amount |
[in] | rotOrder | the orger of the rotation |
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.
[in] | object | dag node to be removed from the scene |
Delete the given dag node or dependency graph node.
[in] | object | node to be deleted |
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.
[in] | rotateView | If true then the viewing camera will be rotated |
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.
[in] | rotateView | If true then the viewing camera will be rotated |
bool isYAxisUp | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
This method returns true if, currently, the Y-axis is UP.
[in] | ReturnStatus |
bool isZAxisUp | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
This method returns true if, currently, the Z-axis is UP.
[in] | ReturnStatus |
This method returns the model's current up axis.
[in] | ReturnStatus |
void displayInfo | ( | const MString & | theMessage | ) | [static] |
This method is used to display an informational message in the script editor.
[in] | theMessage | The message string to be displayed |
void displayWarning | ( | const MString & | theWarning | ) | [static] |
This method is used to display a warning in the script editor.
[in] | theWarning | The warning string to be displayed |
void displayError | ( | const MString & | theError | ) | [static] |
This method is used to display an error in the script editor.
[in] | theError | The error string to be displayed |
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.
[in] | state | true or false |
bool disableStow | ( | ) | [static] |
This method is used to query if the disabling of Stowing (hiding) and Unstowing (showing) windows is active.
int optionVarIntValue | ( | const MString & | name, |
bool * | exists =
NULL |
||
) | [static] |
This method is used to get the option variable value of int type.
[in] | name | option variable name |
[out] | exists | true if variable exists, false otherwise |
double optionVarDoubleValue | ( | const MString & | name, |
bool * | exists =
NULL |
||
) | [static] |
This method is used to get the option variable value of type double.
[in] | name | option variable name |
[out] | exists | true if variable exists, false otherwise |
This method is used to get the option variable value of type string.
[in] | name | option variable name |
[out] | exists | true if variable exists, false otherwise |
bool setOptionVarValue | ( | const MString & | name, |
int | value | ||
) | [static] |
This method is used to set the option variable value of int type.
[in] | name | option variable name |
[in] | value | option variable value to set |
bool setOptionVarValue | ( | const MString & | optionVarName, |
double | value | ||
) | [static] |
This method is used to set the option variable value of type double.
[in] | optionVarName | option variable name |
[in] | value | option variable value to set |
This method is used to set the option variable value of type string.
[in] | name | option variable name |
[in] | value | option variable value to set |
Determines the default path name of the error log file.
Returns an empty string on failure.
[out] | ReturnStatus | Status code |
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.
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.
[in] | logPathName | Path of the new error log file |
Determines the path name of the current error log file.
Returns the null string on failure.
[out] | ReturnStatus | Status Code (see below) |
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.
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.
[in] | logPathName | Path of the error log file |
bool errorLoggingIsOn | ( | MStatus * | ReturnStatus =
NULL |
) | [static] |
This method determines whether or not API errors are being logged.
[out] | ReturnStatus | Status Code (see below) |
MStatus stopErrorLogging | ( | ) | [static] |
This method disables output to the API error log but does not close the log file.
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.
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.
[in] | errorLogEntry | Information to log to file |
bool isUndoing | ( | ) | [static] |
Returns true if Maya is currently in the middle of an undo.
bool isRedoing | ( | ) | [static] |
Returns true if Maya is currently in the middle of an redo.
const char * className | ( | ) | [static] |
bool getOptionVarValue | ( | const MString & | name, |
int & | value | ||
) | [static] |
This method is obsolete. This method is not available in Python.
[in] | name | |
[out] | value |
bool getOptionVarValue | ( | const MString & | name, |
double & | value | ||
) | [static] |
This method is obsolete. This method is not available in Python.
[in] | name | |
[out] | value |
This method is obsolete. This method is not available in Python.
[in] | name | |
[out] | value |
MStatus select | ( | MDagPath & | object, |
const MObject & | component, | ||
MGlobal::ListAdjustment | listAdjustment =
kAddToList |
||
) | [static] |
This method is obsolete. This method is not available in Python.
[in] | object | |
[in] | component | |
[in] | listAdjustment |
This method is obsolete. This method is not available in Python.
[in] | object | |
[in] | component |