Class to allow control on Viewport 2.0 selection behavior. More...
#include <MSelectionContext.h>
Public Types | |
enum | SelectionLevel { kNone, kObject, kComponent, kFace, kEdge, kVertex } |
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... | |
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.
enum SelectionLevel |
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. Selection level of each individual MIntersection object is determined by primitive type of the render item. |
kFace |
Introduced in 2023.0
Face level. |
kEdge |
Introduced in 2023.0
Edge level. |
kVertex |
Introduced in 2023.0
Vertex level. |
MSelectionContext::SelectionLevel selectionLevel | ( | MStatus * | ReturnStatus = nullptr | ) | const |
Get the selection level used to pick items.
[out] | ReturnStatus | Status code. |
MStatus setSelectionLevel | ( | MSelectionContext::SelectionLevel | level | ) |
Set the selection level to use to pick items.
[in] | level | Set the selection level to use. |
|
static |
Returns the name of this class.