gangshow2003
02-20-2011, 04:38 PM
Hi guys,
I'm writing a script that when it's ran creates it's own panel configuration and set the current view to that new configuration. I've been round in circles trying to figure out the maya mel documentation for this but to no success. The problem is I cannot get it to display anything other than the outliner/persp layout. This is probably down to not understanding what is really going on and what parts to change to get it to do something different! Here is the example given so you don't have to look it up -
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" )') Even when I run this I only get the persp view as a large single pane. When I change the label to just "custom" it then gives me the persp/outliner viewer.
Basically if anyone can offer some explanation as to how to get my own set up and what is going on in this code that would be amazing. I know that's vague but Im just totally confused :/
Thanks all
I'm writing a script that when it's ran creates it's own panel configuration and set the current view to that new configuration. I've been round in circles trying to figure out the maya mel documentation for this but to no success. The problem is I cannot get it to display anything other than the outliner/persp layout. This is probably down to not understanding what is really going on and what parts to change to get it to do something different! Here is the example given so you don't have to look it up -
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" )') Even when I run this I only get the persp view as a large single pane. When I change the label to just "custom" it then gives me the persp/outliner viewer.
Basically if anyone can offer some explanation as to how to get my own set up and what is going on in this code that would be amazing. I know that's vague but Im just totally confused :/
Thanks all
