MSelectionMask Class Reference

#include <MSelectionMask.h>

List of all members.


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.


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 ()
  MSelectionMask (SelectionType selType)
  MSelectionMask (const MSelectionMask &in)
virtual  ~MSelectionMask ()
MStatus  setMask (SelectionType selType)
MStatus  setMask (MSelectionMask &mask)
MStatus  addMask (SelectionType selType)
bool  intersects (SelectionType selType, MStatus *ReturnStatus=NULL) const
bool  intersects (MSelectionMask &mask, MStatus *ReturnStatus=NULL) const
MSelectionMask  operator| (SelectionType selType)
MSelectionMask  operator| (MSelectionMask &mask)
MSelectionMask operator= (const MSelectionMask &other)

Member Enumeration Documentation

Types of objects which can be selected.

Enumerator:
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   

Constructor & Destructor Documentation

MSelectionMask::MSelectionMask (  ) 

Constructor. Creates an empty selection mask.

MSelectionMask::MSelectionMask ( MSelectionMask::SelectionType  selType  ) 

Constructor. Creates a selection mask of the specified type.

Parameters:
[in]  selType  the selection type of this mask

MSelectionMask::MSelectionMask ( const MSelectionMask in  ) 

Copy constructor. Duplicates the given mask

Parameters:
[in]  in  mask to be copied

MSelectionMask::~MSelectionMask (  )  [virtual]

Class destructor. Removes the selection mask.


Member Function Documentation

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

Sets the selection mask to the specified selection type.

Parameters:
[in]  selType  the selection type to be set
Returns:

MStatus MSelectionMask::setMask ( MSelectionMask mask  ) 

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:

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

Add the specified selection type to this mask.

Parameters:
[in]  selType  the selection type to add
Returns:

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

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:

bool MSelectionMask::intersects ( MSelectionMask mask,
MStatus ReturnStatus = NULL  
) const

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:

MSelectionMask 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 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 & MSelectionMask::operator= ( const MSelectionMask other  ) 

Assignment operator.

Parameters:
[in]  other  the mask to be copied
Returns:
A reference to the copied mask

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6