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


modelPanel [-barLayout] [-camera string] [-control] [-copy string] [-defineTemplate string] [-docTag string] [-exists] [-init] [-isUnique] [-label string] [-menuBarVisible boolean] [-modelEditor] [-needsInit] [-parent string] [-popupMenuProcedure script] [-replacePanel string] [-tearOff] [-tearOffCopy string] [-unParent] [-useTemplate string] panelName

modelPanel is undoable, queryable, and editable.

This command creates a panel consisting of a model editor. See the modelEditor command documentation for more information.

Return value

stringThe name of the panel.

In query mode, return type is based on queried flag.


barLayout, camera, control, copy, defineTemplate, docTag, exists, init, isUnique, label, menuBarVisible, modelEditor, needsInit, parent, popupMenuProcedure, replacePanel, tearOff, tearOffCopy, unParent, useTemplate
Long name (short name) Argument types Properties
-exists(-ex) create
Returns true|false depending upon whether the specified object exists. Other flags are ignored.
-defineTemplate(-dt) string create
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.
-useTemplate(-ut) string create
Force the command to use a command template other than the current one.
-init(-in) createedit
Initializes the panel's default state. This is usually done automatically on file -new and file -open.
-label(-l) string queryedit
Specifies the user readable label for the panel.
-copy(-cp) string edit
Makes this panel a copy of the specified panel. Both panels must be of the same type.
-control(-ctl) query
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.
-isUnique(-iu) query
Returns true if only one instance of this panel type is allowed.
-parent(-p) string create
Specifies the parent layout for this panel.
-popupMenuProcedure(-pmp) script queryedit
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.
-unParent(-up) edit
Specifies that the panel should be removed from its layout. This (obviously) cannot be used with query.
-replacePanel(-rp) string edit
Will replace the specifed panel with this panel. If the target panel is within the same layout it will perform a swap.
-tearOff(-to) queryedit
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) string create
Will create this panel as a torn of copy of the specified source panel.
-menuBarVisible(-mbv) boolean createqueryedit
Controls whether the menu bar for the panel is displayed.
-needsInit(-ni) queryedit
(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.
-docTag(-dtg) string createqueryedit
Attaches a tag to the maya panel.
-modelEditor(-me) query
This flag returns the name of the model editor contained by the panel.
-barLayout(-bl) query
This flag returns the name of the layout which is the parent of the panels icon bar.
-camera(-cam) string queryedit
Query or edit the camera in a modelPanel.

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

//    Example 1.
//    Create a model panel in a separate window.
string $window = `window`;
showWindow $window;

//    Example 2.
//    Set the panel configuration to show all 4 model views.
//    Then swap the Perspective View and Front View panels.
setNamedPanelLayout "Four View";
string $perspPanel = `getPanel -withLabel "Persp View"`;
string $frontPanel = `getPanel -withLabel "Front View"`;
modelPanel -edit -replacePanel $frontPanel $perspPanel;