pymel.core.windows.panel

panel(*args, **kwargs)

This command allows editing or querying properties of any panels. Not all of the common properites of panels can be used with this command. Flags such as -tearOff and -replacePanel require that you use the explicit panel command. The command ‘getPanel -typeOf panelName’ will return the explicit type of a panel. In query mode, return type is based on queried flag.

Flags:
Long name (short name) Argument Types Properties
control (ctl) bool ../../../_images/query.gif
 

Returns the top level control for this panel. Usually used for getting a parent to attach popup menus. CAUTION: panels may not have controls at times. This flag can return “” if no control is present.

copy (cp) unicode ../../../_images/edit.gif
 
Makes this panel a copy of the specified panel. Both panels must be of the same type.
createString (cs) bool  
   
defineTemplate (dt) unicode ../../../_images/create.gif
 

Puts a command in a mode where any other flags and args are parsed and added to the command template specified in the argument. They will be used as default arguments in any subsequent invocations of the command when templateName is set as the current template.

docTag (dtg) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Attaches a tag to the maya panel.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.
editString (es) bool  
   
exists (ex) bool ../../../_images/create.gif
 
Returns true|false depending upon whether the specified object exists. Other flags are ignored.
init (init) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Initializes the panel’s default state. This is usually done automatically on file -new and file -open.
isUnique (iu) bool ../../../_images/query.gif
 
Returns true if only one instance of this panel type is allowed.
label (l) unicode ../../../_images/query.gif ../../../_images/edit.gif
 
Specifies the user readable label for the panel.
menuBarVisible (mbv) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Controls whether the menu bar for the panel is displayed.
needsInit (ni) bool ../../../_images/query.gif ../../../_images/edit.gif
 

(Internal) On Edit will mark the panel as requiring initialization. Query will return whether the panel is marked for initialization. Used during file -new and file -open.

parent (p) unicode ../../../_images/create.gif
 
Specifies the parent layout for this panel.
popupMenuProcedure (pmp) script ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies the procedure called for building the panel’s popup menu(s). The default value is “buildPanelPopupMenu”. The procedure should take one string argument which is the panel’s name.

replacePanel (rp) unicode ../../../_images/edit.gif
 
Will replace the specifed panel with this panel. If the target panel is within the same layout it will perform a swap.
tearOff (to) bool ../../../_images/query.gif ../../../_images/edit.gif
 

Will tear off this panel into a separate window with a paneLayout as the parent of the panel. When queried this flag will return if the panel has been torn off into its own window.

tearOffCopy (toc) unicode ../../../_images/create.gif
 
Will create this panel as a torn of copy of the specified source panel.
unParent (up) bool ../../../_images/edit.gif
 
Specifies that the panel should be removed from its layout. This (obviously) cannot be used with query.
useTemplate (ut) unicode ../../../_images/create.gif
 
Force the command to use a command template other than the current one.

Derived from mel command maya.cmds.panel

Example:

import pymel.core as pm

import maya.cmds as cmds

MyLabel = 'My Panel'
pm.window()
# Result: ui.Window('window1') #
pm.frameLayout( lv=0 )
# Result: ui.FrameLayout('window1|frameLayout16') #
pm.modelPanel( l=MyLabel )
# Result: ui.ModelPanel('modelPanel6') #
pm.showWindow()

panels = pm.getPanel( all=True )

for panel in panels:
        if MyLabel == pm.panel( panel, q=True, label=True ):
                myPanel = panel
                print( 'Found: '+MyLabel )

Previous topic

pymel.core.windows.paneLayout

Next topic

pymel.core.windows.panelConfiguration

Core

Core Modules

Other Modules

This Page