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

Synopsis

selectedNodes([dagObjects=boolean])

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

selectedNodes is undoable, queryable, and editable.

string[] Return a list of all the dependency nodes on the active list.

Return value

a list of strings

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

Related

select, selectKey, selectMode, selectPref, selectPriority, selectType

Flags

dagObjects
Long name (short name) argument types Properties
dagObjects(do) boolean create
Only return dag objects that are on the active list.

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

nodes = cmds.selectedNodes()

# Return dag objects only
dagnodes = cmds.selectedNodes(dagObjects=True)