Manage what is selectable in Maya. (OpenMaya) (OpenMaya.py)
Selection masks provide a way to control what is selectable in Maya.
Selection masks can be created by OR'ing several types together, or by using the addMask method to add a selection type to an MSelectionMask.
Example - to set the object selection mask to nurbsSurfaces, nurbsCurves, cameras, and lights
MSelectionMask mask( MSelectionMask::kSelectNurbsSurfaces ); mask.addMask( MSelectionMask::kSelectNurbsCurves ); mask = mask | MSelectionMask::kSelectCameras | MSelectionMask::kSelectLights; MGlobal::setObjectSelectionMask( mask );
apiMeshShape.cpp, apiMeshShape.h, apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, and quadricShape.cpp.
#include <MSelectionMask.h>
enum SelectionType |
Types of objects which can be selected.
MSelectionMask | ( | ) |
Constructor.
Creates an empty selection mask.
MSelectionMask | ( | MSelectionMask::SelectionType | selType | ) |
Constructor.
Creates a selection mask of the specified type.
[in] | selType | the selection type of this mask |
MSelectionMask | ( | const MSelectionMask & | in | ) |
Copy constructor.
Duplicates the given mask
[in] | in | mask to be copied |
~MSelectionMask | ( | ) | [virtual] |
Class destructor.
Removes the selection mask.
MStatus setMask | ( | MSelectionMask::SelectionType | selType | ) |
Sets the selection mask to the specified selection type.
[in] | selType | the selection type to be set |
MStatus setMask | ( | MSelectionMask & | mask | ) |
Sets the selection type for this mask to the selection type of the specified mask.
[in] | mask | the mask with the selection type to be set |
MStatus addMask | ( | MSelectionMask::SelectionType | selType | ) |
Add the specified selection type to this mask.
[in] | selType | the selection type to add |
bool intersects | ( | MSelectionMask::SelectionType | selType, |
MStatus * | ReturnStatus =
NULL |
||
) | const |
Returns true if the specified selection type is contained within this selection mask.
[in] | selType | the selection type to test |
[out] | ReturnStatus | status code |
bool intersects | ( | MSelectionMask & | mask, |
MStatus * | ReturnStatus =
NULL |
||
) | const |
Returns true if the specified selection mask is contained within this selection mask.
[in] | mask | the selection mask to test |
[out] | ReturnStatus | status code |
MSelectionMask operator| | ( | MSelectionMask::SelectionType | selType | ) |
Add the specified selection type to this mask.
[in] | selType | the selection type to add |
MSelectionMask operator| | ( | MSelectionMask & | mask | ) |
Add the selection type of the specified mask to this mask.
[in] | mask | the mask containing the selection type to add |
MSelectionMask & operator= | ( | const MSelectionMask & | other | ) |
Assignment operator.
[in] | other | the mask to be copied |