Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

selectMode([component=boolean], [hierarchical=boolean], [leaf=boolean], [object=boolean], [preset=boolean], [root=boolean], [template=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

selectMode is undoable, queryable, and NOT editable.

The selectMode command is used to change the selection mode. Object, component, root, leaf and template modes are mutually exclusive.

Return value

booleanif a query operation

In query mode, return type is based on queried flag.

Related

select, selectKey, selectPref, selectPriority, selectType, selectedNodes

Flags

component, hierarchical, leaf, object, preset, root, template
Long name (short name) Argument types Properties
component(co) boolean createquery
Set component selection on. Component selection mode allows filtered selection based on the component selection mask. The component selection mask is the set of selection masks related to objects that indicate which components are selectable.
hierarchical(h) boolean createquery
Set hierarchical selection on. There are three types of hierarchical selection: root, leaf and template. Hierarchical mode is set if root, leaf or template mode is set. Setting to hierarchical mode will set the mode to whichever of root, leaf, or template was last on.
leaf(l) boolean createquery
Set leaf selection mode on. This mode allows the leaf level objects to be selected. It is similar to object selection mode but ignores the object selection mask.
object(o) boolean createquery
Set object selection on. Object selection mode allows filtered selection based on the object selection mask. The object selection mask is the set of selection masks related to objects that indicate which objects are selectable. The masks are controlled by the "selectType" command. Object selection mode selects the leaf level objects.
preset(p) boolean createquery
Allow selection of anything with the mask set, independent of it being an object or a component.
root(r) boolean createquery
Set root selection mode on. This mode allows the root of a hierarchy to be selected by selecting any of its descendents. It ignores the object selection mask.
template(t) boolean createquery
Set template selection mode on. This mode allows selection of templated objects. It selects the templated object closest to the root of the hierarchy.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

cmds.selectMode( object=True )
cmds.selectMode( q=True, component=True )