Go to: Synopsis. Return value. Flags. Python examples.
deleteUI(
string [string...]
, [collection=boolean], [control=boolean], [editor=boolean], [layout=boolean], [menu=boolean], [menuItem=boolean], [panel=boolean], [panelConfig=boolean], [radioMenuItemCollection=boolean], [toolContext=boolean], [uiTemplate=boolean], [window=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
deleteUI is undoable, NOT queryable, and NOT editable.
This command deletes UI objects such as windows and controls. Deleting
a layout or window will also delete all of its children. If a flag
is used then all objects being deleted must be of the specified type.
This command may not be edited or queried.
NOTE: it is recommended that the type flags be used to disambiguate
different kinds of objects with the same name.
None
collection, control, editor, layout, menu, menuItem, panel, panelConfig, radioMenuItemCollection, toolContext, uiTemplate, window
Long name (short name) |
Argument types |
Properties |
window(wnd)
|
boolean
|
|
|
Object names for deletion are all windows.
|
|
layout(lay)
|
boolean
|
|
|
Object names for deletion are all layouts.
|
|
control(ctl)
|
boolean
|
|
|
Object names for deletion are all controls.
|
|
menu(m)
|
boolean
|
|
|
Object names for deletion are all menus.
|
|
menuItem(mi)
|
boolean
|
|
|
Object names for deletion are all menu items.
|
|
collection(cl)
|
boolean
|
|
|
Object names for deletion are all radio or tool collections.
|
|
uiTemplate(uit)
|
boolean
|
|
|
Object names for deletion are all UI templates.
|
|
radioMenuItemCollection(ric)
|
boolean
|
|
|
Object names for deletion are all radio menu item collections.
|
|
panel(pnl)
|
boolean
|
|
|
Object names for deletion are all panels.
|
|
editor(ed)
|
boolean
|
|
|
Object names for deletion are all editors.
|
|
toolContext(tc)
|
boolean
|
|
|
Object names for deletion are all tool contexts.
|
|
panelConfig(pc)
|
boolean
|
|
|
Object names for deletion are panel configurations.
|
|
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.
|
import maya.cmds as cmds
# Example 1.
#
# Create a simple window and then delete it and all of its children
# with one 'deleteUI -window' command.
#
window = cmds.window()
cmds.paneLayout()
cmds.button()
cmds.showWindow( window )
cmds.deleteUI( window, window=True )
# Example 2.
#
# Create a window with a number of buttons and delete a few of the
# buttons with the 'deleteUI -control' command.
#
window = cmds.window()
cmds.columnLayout()
cmds.button()
cmds.button()
cmds.button()
b1 = cmds.button()
b2 = cmds.button()
b3 = cmds.button()
cmds.showWindow( window )
cmds.deleteUI( b1, b2, b3, control=True )