pymel.core.general.select

select(*args, **kwargs)

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/noExpandflag 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 fooprefix in the root namespace. It is not trying to look for all objects in the namespace with the fooprefix. 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 lscommand without any arguments. When using the -all, adn/allDependencyNodesor -ado/allDagObjectsflags, only the deletable objects are selected. The non deletable object can still be selected by explicitly specifying their name as in select time1;.

Modifications:
  • passing an empty list no longer causes an error. instead, the selection is cleared
Flags:
  • add : add (bool) [create]

    Indicates that the specified items should be added to the active list without removing existing items from the active list.

  • addFirst : af (bool) [create]

    Indicates that the specified items should be added to the front of the active list without removing existing items from the active list.

  • all : all (bool) [create]

    Indicates that all deletable root level dag objects and all deletable non-dag dependency nodes should be selected.

  • allDagObjects : ado (bool) [create]

    Indicates that all deletable root level dag objects should be selected.

  • allDependencyNodes : adn (bool) [create]

    Indicates that all deletable dependency nodes including all deletable dag objects should be selected.

  • clear : cl (bool) [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 -neflag is also specified.

  • containerCentric : cc (bool) [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 have multiple arguments, passed either as a tuple or a list.

  • deselect : d (bool) [create]

    Indicates that the specified items should be removed from the active list if they are on the active list.

  • hierarchy : hi (bool) [create]

    Indicates that all children, grandchildren, ... of the specified dag objects should also be selected.

  • noExpand : ne (bool) [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.

  • replace : r (bool) [create]

    Indicates that the specified items should replace the existing items on the active list.

  • toggle : tgl (bool) [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.

  • visible : vis (bool) [create]

    Indicates that of the specified items only those that are visible should be affected.

Derived from mel command maya.cmds.select

Previous topic

pymel.core.general.scaleComponents

Next topic

pymel.core.general.selectKey

Core

Core Modules

Other Modules

This Page