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

Synopsis

getPanel [-allConfigs] [-allPanels] [-allScriptedTypes] [-allTypes] [-atPosition int int] [-configWithLabel string] [-containing string] [-invisiblePanels] [-scriptType string] [-type string] [-typeOf string] [-underPointer] [-visiblePanels] [-withFocus] [-withLabel string]

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
-allPanels(-all) create
Return the names of all the panels in a string array.
-allTypes(-at) create
Return the names of all types of panels, except scripted types in a string array.
-allScriptedTypes(-ast) create
Return the names of all types of scripted panels in a string array.
-visiblePanels(-vis) create
Return the names of all the visible panels in a string array.
-invisiblePanels(-inv) create
Return the names of all the invisible panels in a string array.
-type(-typ) string create
Return the names of all panels of the specified type in a string array.
-scriptType(-sty) string create
Return the names of all scripted panels of the specified type in a string array.
-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.
-underPointer(-up) 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.
-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.
-withFocus(-wf) 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.
-typeOf(-to) string create
Return the type of the specified panel.
-withLabel(-wl) string create
Return the name of the panel with the specified label text.
-configWithLabel(-cwl) string create
Return the name of the panel configuration with the specified label text.
-allConfigs(-ac) create
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 be used more than once in a command.

MEL examples

getPanel -all;
getPanel -type modelPanel;
getPanel -containing button0;
getPanel -underPointer;
getPanel -withFocus;

// 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.
global proc panePopAt(int $x, int $y)
{
        string  $panel = `getPanel -atPosition $x $y`;

        if ($panel != "") {
                doSwitchPanes(1, { "single", $panel });
        }
}

hotBox -noClickCommand panePopAt -noClickPosition;