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

Synopsis

panelConfiguration( [name] , [addPanel=[boolean, string, string, string, string]], [configString=string], [createStrings=boolean], [defaultImage=string], [defineTemplate=string], [editStrings=boolean], [exists=boolean], [image=string], [isFixedState=boolean], [label=string], [labelStrings=boolean], [numberOfPanels=boolean], [removeAllPanels=boolean], [removeLastPanel=boolean], [replaceCreateString=[int, string]], [replaceEditString=[int, string]], [replaceFixedState=[int, boolean]], [replaceLabel=[int, string]], [replacePanel=[int, boolean, string, string, string, string]], [replaceTypeString=[int, string]], [sceneConfig=boolean], [typeStrings=boolean], [useTemplate=string])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

panelConfiguration is undoable, queryable, and editable.

This command creates a panel configuration object. Typically you would not call this method command directly. Instead use the Panel Editor.

Once a panel configuration is created you can make it appear in the main Maya window by selecting it from any panel's "Panels->Saved Layouts" menu.

Return value

stringThe name of the panelConfiguration created.

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

Flags

addPanel, configString, createStrings, defaultImage, defineTemplate, editStrings, exists, image, isFixedState, label, labelStrings, numberOfPanels, removeAllPanels, removeLastPanel, replaceCreateString, replaceEditString, replaceFixedState, replaceLabel, replacePanel, replaceTypeString, sceneConfig, typeStrings, useTemplate
Long name (short name) Argument types Properties
exists(ex) boolean 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.
label(l) string createqueryedit
Configuration label.
defaultImage(di) string createquery
The default image for this configuration. Once the default image is set it may not be changed. If an image is set with the -i/image flag then it's value will take precedence.
image(i) string createqueryedit
The user specified image for this configuration. Use this flag to override the default image.
sceneConfig(sc) boolean createqueryedit
Specifies whether the configuration is associated with the scene. Scene configurations are created when the scene is opened and deleted when the scene is closed.
configString(cfs) string createqueryedit
Specifies the string that arranges the panels.
numberOfPanels(np) boolean query
Returns the number of panels in the configuration.
addPanel(ap) [boolean, string, string, string, string] createeditmultiuse
Adds the specified panel to the configuration. Arguments are: isFixed, label string, type string, create string, edit string.
replacePanel(rp) [int, boolean, string, string, string, string] createedit
Replaces the specified panel in the configuration. Arguments are: index, isFixed, label string, type string, create string, edit string. The index is 1 based.
replaceLabel(rl) [int, string] edit
Replaces the specified label. The index is 1 based.
replaceEditString(res) [int, string] edit
Replaces the specified edit string. The index is 1 based.
replaceCreateString(rcs) [int, string] edit
Replaces the specified create string. The index is 1 based.
replaceFixedState(rfs) [int, boolean] edit
Replaces the specified fixed state value (true|false). The index is 1 based.
replaceTypeString(rts) [int, string] edit
Replaces the specified type string. The index is 1 based.
removeLastPanel(rlp) boolean edit
Removes the last panel in the config.
removeAllPanels(rap) boolean edit
Removes the last panel in the config.
isFixedState(isFixedState) boolean query
Returns an integer array of whether the panels have fixed states or not.
labelStrings(ls) boolean query
Returns an string array of the panel labels.
typeStrings(ts) boolean query
Returns an string array of the panel types.
createStrings(cs) boolean query
Returns an string array of the panel creation strings.
editStrings(es) boolean query
Returns an string array of the panel edit strings.

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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

#    Create a custom panel configuration.
#
configName = cmds.panelConfiguration(
				label="Custom Panel Layout",
				sceneConfig=False,
				configString="paneLayout -e -cn \"vertical2\" -ps 1 39 100 -ps 2 61 100 $gMainPane;",
				addPanel=[
					(False,
					'Outliner',
					'outlinerPanel',
					("{global int $gUseMenusInPanels;\
					$panelName = `outlinerPanel -mbv $gUseMenusInPanels -unParent -l \"Outliner\"`;\
					outlinerEditor -e -highlightActive true $panelName;}"),
					"outlinerPanel -edit -l \"Outliner\"  $panelName"),

					(True,
					"Persp View",
					"modelPanel",
					("{global int $gUseMenusInPanels;\
					modelPanel -mbv $gUseMenusInPanels\
					-unParent -l \"Persp View\" -cam persp;}" ),
					"modelPanel -edit -l \"Persp View\"  -cam \"persp\" $panelName")
				]
			)

#    Update the main Maya window to reflect the custom panel configuration.
#    Note also that your custom configuration may be selected from any
#    panel's "Panels->Saved Layouts" menu.
#
maya.mel.eval('setNamedPanelLayout( "Custom Panel Layout" )')