OpenMaya.MGlobal Class Reference

Class Description

Static class providing common API global functions.

MGlobal is currently a stub which only implements a small portion of the class's total functionality.

Constructors

MGlobal is a pure static class. It cannot be instantiated and therefore has no constructors.

str() Support

Not applicable as the class cannot be instantiated.

repr() Support

Not applicable as the class cannot be instantiated.

 


+ Inheritance diagram for OpenMaya.MGlobal:

Static Public Member Functions

animSelectionMask ()
 
componentSelectionMask ()
 
getRichSelection ()
 
isRedoing ()
 
isUndoing ()
 
miscSelectionMask ()
 
objectSelectionMask ()
 
selectionMode ()
 
setActiveSelectionList ()
 
setAnimSelectionMask ()
 
setComponentSelectionMask ()
 
setMiscSelectionMask ()
 
setObjectSelectionMask ()
 
setRichSelection ()
 
setSelectionMode ()
 
Available in Maya 2012 HotFix 1:
displayError ()
 
displayInfo ()
 
displayWarning ()
 
getFunctionSetList ()
 
getSelectionListByName ()
 
Available in Maya 2012 Gold:
getActiveSelectionList ()
 

Static Public Attributes

List Adjustment Modes
int kAddToHeadOfList = 4
 
int kAddToList = 2
 
int kRemoveFromList = 3
 
int kReplaceList = 0
 
int kXORWithList = 1
 
Maya States
int kBaseUIMode = 3
 
int kBatch = 1
 
int kInteractive = 0
 
int kLibraryApp = 2
 
Selection Modes
int kSelectComponentMode = 1
 
int kSelectLeafMode = 3
 
int kSelectObjectMode = 0
 
int kSelectRootMode = 2
 
int kSelectTemplateMode = 4
 
Selection Methods
int kSurfaceSelectMethod = 0
 
int kWireframeSelectMethod = 1
 

Member Function Documentation

OpenMaya.MGlobal.animSelectionMask ( )
static
animSelectionMask() -> MSelectionMask

Returns the animation selection mask.
OpenMaya.MGlobal.componentSelectionMask ( )
static
componentSelectionMask() -> MSelectionMask

Returns the component selection mask.
OpenMaya.MGlobal.displayError ( )
static
displayError(msg) -> None

Display an error in the script editor.
Name: displayError(msg)
Parameters: msg - string
Returns:
Description: Display an error in the script editor.
OpenMaya.MGlobal.displayInfo ( )
static
displayInfo(msg) -> None

Display an informational message in the script editor.
Name: displayInfo(msg)
Parameters: msg - string
Returns:
Description: Display an informational message in the script editor.
OpenMaya.MGlobal.displayWarning ( )
static
displayWarning(msg) -> None

Display a warning in the script editor.
Name: displayWarning(msg)
Parameters: msg - string
Returns:
Description: Display a warning in the script editor.
OpenMaya.MGlobal.getActiveSelectionList ( )
static
getActiveSelectionList(orderedSelectionIfAvailable=False) -> MSelectionList

Return an MSelectionList containing the nodes, components and
plugs currently selected in Maya. If orderedSelectionIfAvailable
is True, and tracking is enabled, will return the selected items
in the order that they were selected.
Name: getActiveSelectionList()
Parameters:  
Returns: MSelectionList
Description: Returns a copy of the active selection list.
OpenMaya.MGlobal.getFunctionSetList ( )
static
getFunctionSetList(MObject) -> (string, string, ...)

Returns a tuple of strings that represent the type of each function
set that will accept this object.
Name: getFunctionSetList(object)
Parameters: object - MObject
Returns: tuple of strings
Description: Returns a tuple of strings that represent the type of each function set that will accept this object.
OpenMaya.MGlobal.getRichSelection ( )
static
getRichSelection(defaultToActiveSelection=True) -> MRichSelection

Returns the current rich selection (usually the active selection with
any soft selection and symmetry applied). If no rich selection exists
and 'defaultToActiveSelection' is True, the current active selection
will be returned instead.
OpenMaya.MGlobal.getSelectionListByName ( )
static
getSelectionListByName(name) -> MSelectionList

Returns an MSelectionList with all of the objects that match the
specified name. The name may use the same type of regular expressions
as can be used in MEL commands. For example, the pattern 'pCube*' will
match all occurrences of objects whose names begin with 'pCube'.
Name: getSelectionListByName(name)
Parameters: name - string
Returns: MSelectionList
Description: Returns a selection list with all of the objects that match the specified name. The name may use the same type of regular expressions as can be used in MEL commands. For example, the pattern "pCube*" will match all occurrences of objects whose names begin with "pCube".
OpenMaya.MGlobal.isRedoing ( )
static
isRedoing() -> bool

true if Maya is currently in the middle of a redo.
OpenMaya.MGlobal.isUndoing ( )
static
isUndoing() -> bool

true if Maya is currently in the middle of an undo.
OpenMaya.MGlobal.miscSelectionMask ( )
static
miscSelectionMask() -> MSelectionMask

Returns the miscellaneous selection mask.
OpenMaya.MGlobal.objectSelectionMask ( )
static
objectSelectionMask() -> MSelectionMask

Returns the object selection mask.
OpenMaya.MGlobal.selectionMode ( )
static
selectionMode() -> int

Get current 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.
OpenMaya.MGlobal.setActiveSelectionList ( )
static
setActiveSelectionList(MSelectionList, listAdjustment=kReplaceList) -> None

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.
Valid listAdjustment values are:
  kReplaceList              #Totally replace the list with the given items.
  kXORWithList              #Any of the items which are already on the list will be removed.
            #Any which are not already on the list will be added to the end
            #of the list.
  kAddToList                    #Remove the items from the list.
  kAddToHeadOfList              #Add the items to the beginning of the list.
OpenMaya.MGlobal.setAnimSelectionMask ( )
static
setAnimSelectionMask(mask) -> selfsetAnimSelectionMask(type) -> self

Set the animation selection mask to the supplied value.

* mask (MSelectionMask) - The selection mask.
* type (int) - The selection type (see MSelectionMask.addMask() for a list of values).
OpenMaya.MGlobal.setComponentSelectionMask ( )
static
setComponentSelectionMask(mask) -> selfsetComponentSelectionMask(type) -> self

Set the component selection mask to the supplied value.

* mask (MSelectionMask) - The selection mask.
* type (int) - The selection type (see MSelectionMask.addMask() for a list of values).
OpenMaya.MGlobal.setMiscSelectionMask ( )
static
setMiscSelectionMask(mask) -> selfsetMiscSelectionMask(type) -> self

Set the miscellaneous selection mask to the supplied value.

* mask (MSelectionMask) - The selection mask.
* type (int) - The selection type (see MSelectionMask.addMask() for a list of values).
OpenMaya.MGlobal.setObjectSelectionMask ( )
static
setObjectSelectionMask(mask) -> selfsetObjectSelectionMask(type) -> self

Set the object selection mask to the supplied value.

* mask (MSelectionMask) - The selection mask.
* type (int) - The selection type (see MSelectionMask.addMask() for a list of values).
OpenMaya.MGlobal.setRichSelection ( )
static
setRichSelection(MRichSelection) -> None

Set the current rich selection.
OpenMaya.MGlobal.setSelectionMode ( )
static
setSelectionMode(int) -> None

Set the current selection mode.
See selectionMode() for a list of valid modes.

Member Data Documentation

OpenMaya.MGlobal.kAddToHeadOfList = 4
static
Name: kAddToHeadOfList
Type: int
Description: Add the items to the beginning of the list.
OpenMaya.MGlobal.kAddToList = 2
static
Name: kAddToList
Type: int
Description: Add the items to the end of the list.
OpenMaya.MGlobal.kBaseUIMode = 3
static
Name: kBaseUIMode
Type: int
Description: Running with UI functionality enabled but Maya's standard UI startup scripts are not run. Allows users to provide their own UI.
OpenMaya.MGlobal.kBatch = 1
static
Name: kBatch
Type: int
Description: Running without a UI.
OpenMaya.MGlobal.kInteractive = 0
static
Name: kInteractive
Type: int
Description: Running with a UI.
OpenMaya.MGlobal.kLibraryApp = 2
static
Name: kLibraryApp
Type: int
Description: Running as standalone (MLibrary) application.
OpenMaya.MGlobal.kRemoveFromList = 3
static
Name: kRemoveFromList
Type: int
Description: Remove the items from the list.
OpenMaya.MGlobal.kReplaceList = 0
static
Name: kReplaceList
Type: int
Description: Totally replace the list with the given items.
OpenMaya.MGlobal.kSelectComponentMode = 1
static
Name: kSelectComponentMode
Type: int
Description: Select components.
OpenMaya.MGlobal.kSelectLeafMode = 3
static
Name: kSelectLeafMode
Type: int
Description: Select DAG leaves.
OpenMaya.MGlobal.kSelectObjectMode = 0
static
Name: kSelectObjectMode
Type: int
Description: Select objects.
OpenMaya.MGlobal.kSelectRootMode = 2
static
Name: kSelectRootMode
Type: int
Description: Select DAG roots.
OpenMaya.MGlobal.kSelectTemplateMode = 4
static
Name: kSelectTemplateMode
Type: int
Description: Select templated objects.
OpenMaya.MGlobal.kSurfaceSelectMethod = 0
static
Name: kSurfaceSelectMethod
Type: int
Description: Select based on the surface of the objects.
OpenMaya.MGlobal.kWireframeSelectMethod = 1
static
Name: kWireframeSelectMethod
Type: int
Description: Select based on the wireframe of the objects.
OpenMaya.MGlobal.kXORWithList = 1
static
Name: kXORWithList
Type: int
Description: Any of the items which are already on the list will be removed. Any which are not already on the list will be added to the end of the list.