pymel.core.windows.getPanel

getPanel(*args, **kwargs)

This command returns panel and panel configuration information.

Modifications:
  • returns a Panel object for flags: (containing or underPointer or withFocus)
  • returns a list of Panel 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 appear in Create mode of commandFlag 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

import maya.cmds as cmds

pm.getPanel( all=True )
# Result: [ui.Panel('modelPanel1'), ui.Panel('modelPanel2'), ui.Panel('modelPanel3'), ui.Panel('modelPanel4'), ui.Panel('outlinerPanel1'), ui.Panel('graphEditor1'), ui.Panel('dopeSheetPanel1'), ui.Panel('clipEditorPanel1'), ui.Panel('sequenceEditorPanel1'), ui.Panel('hyperGraphPanel1'), ui.Panel('hyperShadePanel1'), ui.Panel('visorPanel1'), ui.Panel('nodeEditorPanel1'), ui.Panel('createNodePanel1'), ui.Panel('polyTexturePlacementPanel1'), ui.Panel('renderView'), ui.Panel('blendShapePanel1'), ui.Panel('dynRelEdPanel1'), ui.Panel('relationshipPanel1'), ui.Panel('referenceEditorPanel1'), ui.Panel('componentEditorPanel1'), ui.Panel('dynPaintScriptedPanel'), ui.Panel('scriptEditorPanel1'), ui.Panel('StereoPanel')] #
pm.getPanel( type='modelPanel' )
# Result: [ui.Panel('modelPanel1'), ui.Panel('modelPanel2'), ui.Panel('modelPanel3'), ui.Panel('modelPanel4')] #
pm.getPanel( containing='button0' )
pm.getPanel( underPointer=True )
pm.getPanel( withFocus=True )
# Result: ui.Panel('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