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

Synopsis

lsUI( [objects] , [cmdTemplates=boolean], [collection=boolean], [contexts=boolean], [controlLayouts=boolean], [controls=boolean], [dumpWidgets=boolean], [editors=boolean], [head=int], [long=boolean], [menuItems=boolean], [menus=boolean], [numWidgets=boolean], [panels=boolean], [radioMenuItemCollections=boolean], [tail=int], [type=string], [windows=boolean])

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

lsUI is undoable, NOT queryable, and NOT editable.

This command returns the names of UI objects.

Return value

string[]The names of the object arguments.

Flags

cmdTemplates, collection, contexts, controlLayouts, controls, dumpWidgets, editors, head, long, menuItems, menus, numWidgets, panels, radioMenuItemCollections, tail, type, windows
Long name (short name) Argument types Properties
long(l) boolean create
Use long pathnames instead of short non-path names.
head(hd) int create
The parameter specifies the maximum number of elements to be returned from the beginning of the list of items. (Note: each flag will return at most this many items so if multiple flags are specified then the number of items returned will be greater than the value specified).
tail(tl) int create
The parameter specifies the maximum number of elements to be returned from the end of the list of items. (Note: each flag will return at most this many items so if multiple flags are specified then the number of items returned will be greater than the value specified).
type(typ) string createmultiuse
List all objects of a certain type specified by the string argument. For example, "window", "menu", "control", or "controlLayout".
panels(p) boolean create
All currently existing panels.
editors(ed) boolean create
All currently existing editors.
windows(wnd) boolean create
Windows created using ELF UI commands.
controls(ctl) boolean create
Controls created using ELF UI commands. [e.g. buttons, checkboxes, etc]
controlLayouts(cl) boolean create
Control layouts created using ELF UI commands [e.g. formLayouts, paneLayouts, etc.]
collection(col) boolean create
Control collections created using ELF UI commands.
radioMenuItemCollections(rmc) boolean create
Menu item collections created using ELF UI commands.
menus(m) boolean create
Menus created using ELF UI commands.
menuItems(mi) boolean create
Menu items created using ELF UI commands.
numWidgets(nw) boolean create
Reports the number of QT widgets used by Maya.
dumpWidgets(dw) boolean create
Dump all QT widgets used by Maya.
contexts(ctx) boolean create
Tool contexts created using ELF UI commands.
cmdTemplates(ct) boolean create
UI command templates created using ELF UI commands.

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

#    List all windows.
#
cmds.lsUI( windows=True )

#    List all panels and editors.
#
cmds.lsUI( panels=True, editors=True )

#    Use the -typ/type flag to list all controls and control layouts.
#    Alternatively, you could use the -ctl/controls and -cl/controlLayouts
#    flags.
#
cmds.lsUI( type=['control','controlLayout'] )

#    Or...
#
cmds.lsUI( controls=True, controlLayouts=True )