PDA

View Full Version : panelConfiguration and paneLayout help


gangshow2003
02-20-2011, 05: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

EightBit
02-21-2011, 11:32 PM
For starters, your mixing Python and Mel. Maybe just use Python?

gangshow2003
02-22-2011, 12:18 AM
this is the example given in the maya documentation. I know both languages so it's not too much of a problem in that sence. Its what the different parts correspond to that Im confused with. Cheers

EightBit
02-22-2011, 07:33 AM
I avoid Mel like the plague, so I don't have anything to offer.
If I wanted that function, I'd see if I could write it entirely in Python by looking up each command individually.

CGTalk Moderation
02-22-2011, 07:33 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.