- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# MSelectionMask Class Reference

Search for all occurrences

## Detailed Description

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

Examples:

  apiMeshShape.cpp, apiMeshShape.h, apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, and quadricShape.cpp.

`#include <MSelectionMask.h>`

List of all members.

## Public Types
enum | SelectionType { kSelectHandles, kSelectLocalAxis, kSelectIkHandles, kSelectIkEndEffectors, kSelectJoints, kSelectLights, kSelectCameras, kSelectLattices, kSelectClusters, kSelectSculpts, kSelectNurbsCurves, kSelectNurbsSurfaces, kSelectMeshes, kSelectSubdiv, kSelectSketchPlanes, kSelectParticleShapes, kSelectEmitters, kSelectFields, kSelectSprings, kSelectRigidBodies, kSelectRigidConstraints, kSelectCollisionModels, kSelectXYZLocators, kSelectOrientationLocators, kSelectUVLocators, kSelectTextures, kSelectCurves, kSelectSurfaces, kSelectLocators, kSelectObjectsMask, kSelectCVs, kSelectHulls, kSelectEditPoints, kSelectMeshVerts, kSelectMeshEdges, kSelectMeshFreeEdges, kSelectMeshFaces, kSelectSubdivMeshPoints, kSelectSubdivMeshEdges, kSelectSubdivMeshFaces, kSelectMeshUVs, kSelectVertices, kSelectEdges, kSelectFacets, kSelectMeshLines, kSelectMeshComponents, kSelectCurveParmPoints, kSelectCurveKnots, kSelectSurfaceParmPoints, kSelectSurfaceKnots, kSelectSurfaceRange, kSelectSurfaceEdge, kSelectIsoparms, kSelectCurvesOnSurfaces, kSelectPPStrokes, kSelectLatticePoints, kSelectParticles, kSelectJointPivots, kSelectScalePivots, kSelectRotatePivots, kSelectPivots, kSelectSelectHandles, kSelectComponentsMask, kSelectAnimCurves, kSelectAnimKeyframes, kSelectAnimInTangents, kSelectAnimOutTangents, kSelectAnimMask, kSelectAnimAny, kSelectTemplates, kSelectManipulators, kSelectGuideLines, kSelectPointsForGravity, kSelectPointsOnCurvesForGravity, kSelectPointsOnSurfacesForGravity, kSelectObjectGroups, kSelectSubdivMeshMaps, kSelectFluids, kSelectHairSystems, kSelectFollicles, kSelectNCloths, kSelectNRigids, kSelectDynamicConstraints, kSelectNParticles }
| Types of objects which can be selected. More...
## Public Member Functions
| MSelectionMask ()
| Constructor.
| MSelectionMask (SelectionType selType)
| Constructor.
| MSelectionMask (const MString &selTypeName)
| Constructor.
| MSelectionMask (const MSelectionMask &in)
| Copy constructor.
virtual | ~MSelectionMask ()
| Class destructor.
MStatus | setMask (SelectionType selType)
| Sets the selection mask to the specified selection type.
MStatus | setMask (MSelectionMask &mask)
| Sets the selection type for this mask to the selection type of the specified mask.
MStatus | addMask (SelectionType selType)
| Add the specified selection type to this mask.
bool | intersects (SelectionType selType, MStatus *ReturnStatus=NULL) const
| Returns true if the specified selection type is contained within this selection mask.
bool | intersects (MSelectionMask &mask, MStatus *ReturnStatus=NULL) const
| Returns true if the specified selection mask is contained within this selection mask.
MSelectionMask | operator| (SelectionType selType)
| Add the specified selection type to this mask.
MSelectionMask | operator| (MSelectionMask &mask)
| Add the selection type of the specified mask to this mask.
MSelectionMask & | operator= (const MSelectionMask &other)
| Assignment operator.
## Static Public Member Functions
static bool | registerSelectionType (const MString &selTypeName, int priority=0)
| Registers a new selection type.
static bool | deregisterSelectionType (const MString &selTypeName)
| Unregisters a previously registered selection type.
static int | getSelectionTypePriority (const MString &selTypeName)
| Gets the selection priority corresponding to a given selection type.

## Member Enumeration Documentation

enum SelectionType

Search for all occurrences

Types of objects which can be selected.

Enumerator:

  kSelectHandles | Search for all occurrences
  kSelectLocalAxis | Search for all occurrences
  kSelectIkHandles | Search for all occurrences
  kSelectIkEndEffectors | Search for all occurrences
  kSelectJoints | Search for all occurrences
  kSelectLights | Search for all occurrences
  kSelectCameras | Search for all occurrences
  kSelectLattices | Search for all occurrences
  kSelectClusters | Search for all occurrences
  kSelectSculpts | Search for all occurrences
  kSelectNurbsCurves | Search for all occurrences
  kSelectNurbsSurfaces | Search for all occurrences
  kSelectMeshes | Search for all occurrences
  kSelectSubdiv | Search for all occurrences
  kSelectSketchPlanes | Search for all occurrences
  kSelectParticleShapes | Search for all occurrences
  kSelectEmitters | Search for all occurrences
  kSelectFields | Search for all occurrences
  kSelectSprings | Search for all occurrences
  kSelectRigidBodies | Search for all occurrences
  kSelectRigidConstraints | Search for all occurrences
  kSelectCollisionModels | Search for all occurrences
  kSelectXYZLocators | Search for all occurrences
  kSelectOrientationLocators | Search for all occurrences
  kSelectUVLocators | Search for all occurrences
  kSelectTextures | Search for all occurrences
  kSelectCurves | Search for all occurrences
  kSelectSurfaces | Search for all occurrences
  kSelectLocators | Search for all occurrences
  kSelectObjectsMask | Search for all occurrences
  kSelectCVs | Search for all occurrences
  kSelectHulls | Search for all occurrences
  kSelectEditPoints | Search for all occurrences
  kSelectMeshVerts | Search for all occurrences
  kSelectMeshEdges | Search for all occurrences
  kSelectMeshFreeEdges | Search for all occurrences
  kSelectMeshFaces | Search for all occurrences
  kSelectSubdivMeshPoints | Search for all occurrences
  kSelectSubdivMeshEdges | Search for all occurrences
  kSelectSubdivMeshFaces | Search for all occurrences
  kSelectMeshUVs | Search for all occurrences
  kSelectVertices | Search for all occurrences
  kSelectEdges | Search for all occurrences
  kSelectFacets | Search for all occurrences
  kSelectMeshLines | Search for all occurrences
  kSelectMeshComponents | Search for all occurrences
  kSelectCurveParmPoints | Search for all occurrences
  kSelectCurveKnots | Search for all occurrences
  kSelectSurfaceParmPoints | Search for all occurrences
  kSelectSurfaceKnots | Search for all occurrences
  kSelectSurfaceRange | Search for all occurrences
  kSelectSurfaceEdge | Search for all occurrences
  kSelectIsoparms | Search for all occurrences
  kSelectCurvesOnSurfaces | Search for all occurrences
  kSelectPPStrokes | Search for all occurrences
  kSelectLatticePoints | Search for all occurrences
  kSelectParticles | Search for all occurrences
  kSelectJointPivots | Search for all occurrences
  kSelectScalePivots | Search for all occurrences
  kSelectRotatePivots | Search for all occurrences
  kSelectPivots | Search for all occurrences
  kSelectSelectHandles | Search for all occurrences
  kSelectComponentsMask | Search for all occurrences
  kSelectAnimCurves | Search for all occurrences
  kSelectAnimKeyframes | Search for all occurrences
  kSelectAnimInTangents | Search for all occurrences
  kSelectAnimOutTangents | Search for all occurrences
  kSelectAnimMask | Search for all occurrences
  kSelectAnimAny | Search for all occurrences
  kSelectTemplates | Search for all occurrences
  kSelectManipulators | Search for all occurrences
  kSelectGuideLines | Search for all occurrences
  kSelectPointsForGravity | Search for all occurrences
  kSelectPointsOnCurvesForGravity | Search for all occurrences
  kSelectPointsOnSurfacesForGravity | Search for all occurrences
  kSelectObjectGroups | Search for all occurrences
  kSelectSubdivMeshMaps | Search for all occurrences
  kSelectFluids | Search for all occurrences
  kSelectHairSystems | Search for all occurrences
  kSelectFollicles | Search for all occurrences
  kSelectNCloths | Search for all occurrences
  kSelectNRigids | Search for all occurrences
  kSelectDynamicConstraints | Search for all occurrences
  kSelectNParticles | Search for all occurrences

## Constructor & Destructor Documentation

MSelectionMask | ( |  | ) |

Constructor.

Creates an empty selection mask.

MSelectionMask | ( | MSelectionMask::SelectionType | selType | ) |

Constructor.

Creates a selection mask of the specified type.

Parameters:

  [in] | selType | the selection type of this mask

MSelectionMask | ( | const MString & | selTypeName | ) |

Constructor.

Creates a selection mask of the specified type.

Parameters:

  [in] | selTypeName | name of the selection type

MSelectionMask | ( | const MSelectionMask & | in | ) |

Copy constructor.

Duplicates the given mask

Parameters:

  [in] | in | mask to be copied

~MSelectionMask | ( |  | ) | `[virtual]`

Class destructor.

Removes the selection mask.

## Member Function Documentation

MStatus setMask | ( | MSelectionMask::SelectionType | selType | ) |

Search for all occurrences

Sets the selection mask to the specified selection type.

Parameters:

  [in] | selType | the selection type to be set

Returns:
  - MS::kSuccess the selection type was successfully set
  - MS::kFailure object error

MStatus setMask | ( | MSelectionMask & | mask | ) |

Search for all occurrences

Sets the selection type for this mask to the selection type of the specified mask.

Parameters:

  [in] | mask | the mask with the selection type to be set

Returns:
  - MS::kSuccess the selection type was successfully set
  - MS::kFailure object error

MStatus addMask | ( | MSelectionMask::SelectionType | selType | ) |

Search for all occurrences

Add the specified selection type to this mask.

Parameters:

  [in] | selType | the selection type to add

Returns:
  - MS::kSuccess the selection type was successfully added
  - MS::kFailure object error

bool intersects | ( | MSelectionMask::SelectionType | selType,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns true if the specified selection type is contained within this selection mask.

Parameters:

  [in] | selType | the selection type to test
  [out] | ReturnStatus | status code

Returns:
  - true the specified selectin type is contained in this mask
  - false the specified selectin type is not in this mask

Status Codes:
  - MS::kSuccess this method succeeded
  - MS::kFailure object error

bool intersects | ( | MSelectionMask & | mask,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns true if the specified selection mask is contained within this selection mask.

Parameters:

  [in] | mask | the selection mask to test
  [out] | ReturnStatus | status code

Returns:
  - true the specified selectin mask is contained in this mask
  - false the specified selectin mask is not in this mask

Status Codes:
  - MS::kSuccess this method succeeded
  - MS::kFailure object error

MSelectionMask operator| | ( | MSelectionMask::SelectionType | selType | ) |

Add the specified selection type to this mask.

Parameters:

  [in] | selType | the selection type to add

Returns:
  The new mask

MSelectionMask operator| | ( | MSelectionMask & | mask | ) |

Add the selection type of the specified mask to this mask.

Parameters:

  [in] | mask | the mask containing the selection type to add

Returns:
  The new mask

MSelectionMask & operator= | ( | const MSelectionMask & | other | ) |

Assignment operator.

Parameters:

  [in] | other | the mask to be copied

Returns:
  A reference to the copied mask

bool registerSelectionType | ( | const MString & | selTypeName,
|  | int | priority = `0`
| ) |  | `[static]`

Search for all occurrences

Registers a new selection type.

Currently only object selection types are supported.

Parameters:

  [in] | selTypeName | Name of the selection type.
  [in] | priority | Priority of the selection type,see 'selectPriority' command.

Returns:
  - true The selection type was successfully registered.
  - false Failed to register the selection type.

bool deregisterSelectionType | ( | const MString & | selTypeName | ) | `[static]`

Search for all occurrences

Unregisters a previously registered selection type.

Parameters:

  [in] | selTypeName | Name of the selection type.

Returns:
  - true The selection type was successfully unregistered.
  - false Failed to unregister the selection type.

int getSelectionTypePriority | ( | const MString & | selTypeName | ) | `[static]`

Search for all occurrences

Gets the selection priority corresponding to a given selection type.

Parameters:

  [in] | selTypeName | Name of the selection type.

Returns:
  The selection priority corresponding to a given selection type. return -1 if there is no select type named selTypeName.

MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask
MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask MSelectionMask