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

Synopsis

select [-add] [-addFirst] [-all] [-allDagObjects] [-allDependencyNodes] [-clear] [-containerCentric] [-deselect] [-hierarchy] [-noExpand] [-replace] [-toggle] [-visible] [objects...]

select is undoable, NOT queryable, and NOT editable.

This command is used to put objects onto or off of the active list. If none of the five flags [-add, -af, -r, -d, -tgl] are specified, the default is to replace the objects on the active list with the given list of objects.

When selecting a set as in "select set1", the behaviour is for all the members of the set to become selected instead of the set itself. If you want to select a set, the "-ne/noExpand" flag must be used.

With the advent of namespaces, selection by name may be confusing. To clarify, without a qualified namespace, name lookup is limited to objects in the root namespace ":". There are really two parts of a name: the namespace and the name itself which is unique within the namespace. If you want to select objects in a specific namespace, you need to include the namespace separator ":".

For example, 'select -r "foo*"' is trying to look for an object with the "foo" prefix in the root namespace. It is not trying to look for all objects in the namespace with the "foo" prefix. If you want to select all objects in a namespace (foo), use 'select "foo:*"'.

Note: When the application starts up, there are several dependency nodes created by the system which must exist. These objects are not deletable but are selectable. All objects (dag and dependency nodes) in the scene can be obtained using the "ls" command without any arguments. When using the "-all", "adn/allDependencyNodes" or "-ado/allDagObjects" flags, only the deletable objects are selected. The non deletable object can still be selected by explicitly specifying their name as in "select time1;".

Return value

None

Related

selectKey, selectMode, selectPref, selectPriority, selectType, selectedNodes

Flags

add, addFirst, all, allDagObjects, allDependencyNodes, clear, containerCentric, deselect, hierarchy, noExpand, replace, toggle, visible
Long name (short name) Argument types Properties
-all(-all) create
Indicates that all deletable root level dag objects and all deletable non-dag dependency nodes should be selected.
-allDependencyNodes(-adn) create
Indicates that all deletable dependency nodes including all deletable dag objects should be selected.
-allDagObjects(-ado) create
Indicates that all deletable root level dag objects should be selected.
-visible(-vis) create
Indicates that of the specified items only those that are visible should be affected.
-hierarchy(-hi) create
Indicates that all children, grandchildren, ... of the specified dag objects should also be selected.
-add(-add) create
Indicates that the specified items should be added to the active list without removing existing items from the active list.
-addFirst(-af) create
Indicates that the specified items should be added to the front of the active list without removing existing items from the active list.
-replace(-r) create
Indicates that the specified items should replace the existing items on the active list.
-deselect(-d) create
Indicates that the specified items should be removed from the active list if they are on the active list.
-toggle(-tgl) create
Indicates that those items on the given list which are on the active list should be removed from the active list and those items on the given list which are not on the active list should be added to the active list.
-clear(-cl) create
Clears the active list. This is more efficient than "select -d;". Also "select -d;" will not remove sets from the active list unless the "-ne" flag is also specified.
-noExpand(-ne) create
Indicates that any set which is among the specified items should not be expanded to its list of members. This allows sets to be selected as opposed to the members of sets which is the default behaviour.
-containerCentric(-cc) create
Specifies that the same selection rules as apply to selection in the main viewport will also be applied to the select command. In particular, if the specified objects are members of a black-boxed container and are not published as nodes, Maya will not select them. Instead, their first parent valid for selection will be selected.

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 be used more than once in a command.

MEL examples

// create some objects and add them to a set
sphere -n sphere1;
sphere -n sphere2;
sets -n set1 sphere1 sphere2;

// select all dag objects and all dependency nodes
select -all;

// clear the active list
select -clear;

// select sphere2 only if it is visible
select -visible sphere2;

// select a couple of objects regardless of visibilty
select -r sphere1;
select -add sphere2;

// remove one of the spheres from the active list (using toggle)
select -tgl sphere1;

// remove the other sphere from the active list
select -d sphere2;

// the following selects all the members of set1
select set1;

// this selects set1 itself
select -ne set1;


// Some examples selecting with namespaces:

// create a namespace and an object in the namespace
namespace -add foo;
namespace -set foo;
sphere -n bar;

// 'select bar' will not select "bar" unless bar is in the
// root namespace. You need to qualify the name with the
// namespace (shown below).
select foo:bar;

// select all the objects in a namespace
select "foo:*";