pymel.core.windows.getPanel

getPanel(*args, **kwargs)

This command returns panel and panel configuration information.

Modifications:
  • returns a PyUI object for flags: (containing or underPointer or withFocus)
  • returns a list of PyUI objects for flags: not typeOf
Flags:
Long name (short name) Argument Types Properties
allConfigs (ac) bool ../../../_images/create.gif
 
Return the names of the all panel configuration in a string array. Flag can have multiple arguments, passed either as a tuple or a list.
allPanels (all) bool ../../../_images/create.gif
 
Return the names of all the panels in a string array.
allScriptedTypes (ast) bool ../../../_images/create.gif
 
Return the names of all types of scripted panels in a string array.
allTypes (at) bool ../../../_images/create.gif
 
Return the names of all types of panels, except scripted types in a string array.
atPosition (ap) int, int ../../../_images/create.gif
 
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) unicode ../../../_images/create.gif
 
Return the name of the panel configuration with the specified label text.
containing (c) unicode ../../../_images/create.gif
 
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) bool ../../../_images/create.gif
 
Return the names of all the invisible panels in a string array.
scriptType (sty) unicode ../../../_images/create.gif
 
Return the names of all scripted panels of the specified type in a string array.
type (typ) unicode ../../../_images/create.gif
 
Return the names of all panels of the specified type in a string array.
typeOf (to) unicode ../../../_images/create.gif
 
Return the type of the specified panel.
underPointer (up) bool ../../../_images/create.gif
 
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) bool ../../../_images/create.gif
 
Return the names of all the visible panels in a string array.
withFocus (wf) bool ../../../_images/create.gif
 
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) unicode ../../../_images/create.gif
 
Return the name of the panel with the specified label text.

Derived from mel command maya.cmds.getPanel

Example:

import pymel.core as pm

pm.getPanel( all=True )
# Result: [ui.ModelEditor('modelPanel1|modelPanel1'), ui.ModelEditor('modelPanel2|modelPanel2'), ui.ModelEditor('modelPanel3|modelPanel3'), ui.ModelEditor('modelPanel4|modelPanel4'), ui.Panel('outlinerPanel1'), ui.ScriptedPanel('graphEditor1'), ui.ScriptedPanel('dopeSheetPanel1'), ui.ScriptedPanel('clipEditorPanel1'), ui.ScriptedPanel('sequenceEditorPanel1'), ui.ScriptedPanel('hyperGraphPanel1'), ui.ScriptedPanel('hyperShadePanel1'), ui.ScriptedPanel('visorPanel1'), ui.ScriptedPanel('polyTexturePlacementPanel1'), ui.ScriptedPanel('renderView'), ui.Panel('blendShapePanel1'), ui.ScriptedPanel('dynRelEdPanel1'), ui.ScriptedPanel('relationshipPanel1'), ui.ScriptedPanel('referenceEditorPanel1'), ui.ScriptedPanel('componentEditorPanel1'), ui.ScriptedPanel('dynPaintScriptedPanel'), ui.ScriptedPanel('scriptEditorPanel1')] #
pm.getPanel( type='modelPanel' )
# Result: [ui.ModelEditor('modelPanel1|modelPanel1'), ui.ModelEditor('modelPanel2|modelPanel2'), ui.ModelEditor('modelPanel3|modelPanel3'), ui.ModelEditor('modelPanel4|modelPanel4')] #
pm.getPanel( containing='button0' )
pm.getPanel( underPointer=True )
# Result: ui.ScriptedPanel('scriptEditorPanel1') #
pm.getPanel( withFocus=True )
# Result: ui.ModelEditor('modelPanel4|modelPanel4') #

# 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 = pm.getPanel(atPosition=(x, y))
    if panel != '':
            mel.eval('doSwitchPanes(1, { "single", "' + panel + '" })')

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

Previous topic

pymel.core.windows.getMainProgressBar

Next topic

pymel.core.windows.glRenderEditor

Core

Core Modules

Other Modules

This Page