C++ API Reference: MSelectionContext Class Reference

Class to allow control on Viewport 2.0 selection behavior. More...

#include <MSelectionContext.h>

Public Types

enum  SelectionLevel { kNone, kObject, kComponent }
 Specifies granularity level to use for the selection. More...
 

Public Member Functions

SelectionLevel selectionLevel (MStatus *ReturnStatus=nullptr) const
 Get the selection level used to pick items. More...
 
MStatus setSelectionLevel (SelectionLevel level)
 Set the selection level to use to pick items. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Detailed Description

Class to allow control on Viewport 2.0 selection behavior.

MSelectionContext provides control on selection behavior for a given DAG object.

It cannot be instantiated by plug-ins. During the pre-filtering phase of Viewport 2.0 selection, an MSelectionContext instance is passed to the following functions for plug-ins to set up selection context for a custom object:

The MSelectionContext instance is only valid inside these functions, thus plug-ins should not save its pointer.

+ Examples:

Member Enumeration Documentation

Specifies granularity level to use for the selection.

Enumerator
kNone 

No selection available.

kObject 

Object level.

Objects are selected as a whole. Components are not directly accessible.

kComponent 

Component level.

Components such as vertices, edges and faces are selectable.

Member Function Documentation

MSelectionContext::SelectionLevel selectionLevel ( MStatus ReturnStatus = nullptr) const

Get the selection level used to pick items.

Parameters
[out]ReturnStatusStatus code.
Returns
The selection level.
Status Codes:
MStatus setSelectionLevel ( MSelectionContext::SelectionLevel  level)

Set the selection level to use to pick items.

Parameters
[in]levelSet the selection level to use.
Returns
Status code
Status Codes:
+ Examples:
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

The documentation for this class was generated from the following files:
  • MSelectionContext.h
  • MSelectionContext.cpp