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

Synopsis

getPanel([allConfigs=boolean], [allPanels=boolean], [allScriptedTypes=boolean], [allTypes=boolean], [atPosition=[int, int]], [configWithLabel=string], [containing=string], [invisiblePanels=boolean], [scriptType=string], [type=string], [typeOf=string], [underPointer=boolean], [visiblePanels=boolean], [withFocus=boolean], [withLabel=string])

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

getPanel is undoable, NOT queryable, and NOT editable.

This command returns panel and panel configuration information.

Return value

string[]An array of panel names

Flags

allConfigs, allPanels, allScriptedTypes, allTypes, atPosition, configWithLabel, containing, invisiblePanels, scriptType, type, typeOf, underPointer, visiblePanels, withFocus, withLabel
Long name (short name) Argument types Properties
allConfigs(ac) boolean create
Return the names of the all panel configuration in a string array.
allPanels(all) boolean create
Return the names of all the panels in a string array.
allScriptedTypes(ast) boolean create
Return the names of all types of scripted panels in a string array.
allTypes(at) boolean create
Return the names of all types of panels, except scripted types in a string array.
atPosition(ap) [int, int] create
Return the name of the panel which contains the specified screen coordinates. An empty string is returned if there is no panel at those coordinates.
configWithLabel(cwl) string create
Return the name of the panel configuration with the specified label text.
containing(c) string create
Return the name of the panel containing the specified control. An empty string is returned if the specified control is not in any panel.
invisiblePanels(inv) boolean create
Return the names of all the invisible panels in a string array.
scriptType(sty) string create
Return the names of all scripted panels of the specified type in a string array.
type(typ) string create
Return the names of all panels of the specified type in a string array.
typeOf(to) string create
Return the type of the specified panel.
underPointer(up) boolean create
Return the name of the panel that the pointer is currently over. An empty string is returned if the pointer is not over any panel.
visiblePanels(vis) boolean create
Return the names of all the visible panels in a string array.
withFocus(wf) boolean create
Return the name of the panel that currently has focus. If no panel has focus then the last panel that had focus is returned.
withLabel(wl) string create
Return the name of the panel with the specified label text.

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

cmds.getPanel( all=True )
cmds.getPanel( type='modelPanel' )
cmds.getPanel( containing='button0' )
cmds.getPanel( underPointer=True )
cmds.getPanel( withFocus=True )

# Whenever the hotBox's 'noClickCommand' is invoked, have it switch the
# main Maya view to a single pane configuration, displaying the panel
# which was under the mouse pointer at the time the 'hotBox' command was
# executed.
def panePopAt(x, y):
	panel = cmds.getPanel(atPosition=(x, y))
	if panel != '':
		mel.eval('doSwitchPanes(1, { "single", "' + panel + '" })')

cmds.hotBox(noClickCommand=panePopAt, noClickPosition=True)