Go to: Synopsis. Return value. Flags. Python examples.
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.
string[] |
An array of panel names |
allConfigs, allPanels, allScriptedTypes, allTypes, atPosition, configWithLabel, containing, invisiblePanels, scriptType, type,
typeOf, underPointer, visiblePanels, withFocus, withLabel
Long name (short name) |
Argument types |
Properties |
allPanels(all) |
boolean |
|
|
Return the names of all the panels in a string array. |
|
allTypes(at) |
boolean |
|
|
Return the names of all types of panels, except scripted types
in a string array. |
|
allScriptedTypes(ast) |
boolean |
|
|
Return the names of all types of scripted panels in a string
array. |
|
visiblePanels(vis) |
boolean |
|
|
Return the names of all the visible panels in a string
array. |
|
invisiblePanels(inv) |
boolean |
|
|
Return the names of all the invisible panels in a string
array. |
|
type(typ) |
string |
|
|
Return the names of all panels of the specified type in a
string array. |
|
scriptType(sty) |
string |
|
|
Return the names of all scripted panels of the specified type
in a string array. |
|
containing(c) |
string |
|
|
Return the name of the panel containing the specified control.
An empty string is returned if the specified control is not in any
panel. |
|
underPointer(up) |
boolean |
|
|
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. |
|
atPosition(ap) |
[int, int] |
|
|
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. |
|
withFocus(wf) |
boolean |
|
|
Return the name of the panel that currently has focus. If no
panel has focus then the last panel that had focus is
returned. |
|
typeOf(to) |
string |
|
|
Return the type of the specified panel. |
|
withLabel(wl) |
string |
|
|
Return the name of the panel with the specified label
text. |
|
configWithLabel(cwl) |
string |
|
|
Return the name of the panel configuration with the specified
label text. |
|
allConfigs(ac) |
boolean |
|
|
Return the names of the all panel configuration in a string
array. |
|
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
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)