PDA

View Full Version : modelEditor vs modelPanel


Omita
03-29-2008, 04:55 AM
I am having a hell of a time trying to get a modelEditor to accept the common navigation keys. I have included some test code. I also can not figure out how to get a modelPanel in a formLayout to work. :)

Thanks in advance.

-H


//modelPanel Example
proc NewPanelWindow()
{
if(`window -exists myPanelWindow`)
deleteUI -window myPanelWindow;
if (`modelPanel -exists myPanelPanel`)
deleteUI -panel myPanelPanel;

window
-title "Panel Window"
-w 550
-h 275
myPanelWindow
;

columnLayout -columnAttach "both" 2 -columnWidth 550;
frameLayout -lv 0 -w 550 -h 180;
modelPanel -mbv 0 -cam "persp" myPanelPanel;
setParent ..;
setParent ..;
rowLayout
-numberOfColumns 2
-columnWidth2 225 225
-columnAlign 1 "center"
-columnAttach 1 "both" 2
-columnAlign 2 "center"
-columnAttach 2 "both" 2
;
button -w 50 -l "Left Button" LeftButton;
button -w 75 -l "Right Button" RightButton;
setParent ..;

showWindow myPanelWindow;
}
//modelEditor Example
proc NewFormWindow()
{
// window;
if (`window -exists myFormWindow`)
deleteUI myFormWindow;
if (`modelEditor -exists myModelEditor`)
deleteUI myModelEditor;

window
-title "Form Window"
-w 550
-h 275
myFormWindow
;

//form layout
formLayout myFormForm;

//----- content
modelEditor -cam "persp" -allObjects 0 -grid 0 -nurbsSurfaces 1 -dimensions 1 myModelEditor;
button -l "Left Button" LeftButton;
button -l "Right Button" RightButton;
//----- end content

//modelEditor -e -interactive myModelEditor;

formLayout -edit
-attachForm myModelEditor top 0
-attachForm myModelEditor left 0
-attachForm myModelEditor right 0
-attachForm myModelEditor bottom 25

-attachControl LeftButton top 2 myModelEditor
-attachForm LeftButton left 0
-attachPosition LeftButton right 2 50
-attachForm LeftButton bottom 2

-attachControl RightButton top 2 myModelEditor
-attachControl RightButton left 2 LeftButton
-attachForm RightButton right 0
-attachForm RightButton bottom 2

//Form
myFormForm
;

showWindow myFormWindow;
}

Omita
03-29-2008, 05:10 AM
Wasn't realizing that ModelPanel was a layout... I think.

-H


//modelEditor Example
proc NewPanelInFormWindow()
{
// window;
if(`window -exists myFormPanelWindow`)
deleteUI -window myFormPanelWindow;
if (`modelPanel -exists myPanelPanel`)
deleteUI -panel myPanelPanel;

window
-title "Form Window"
-w 550
-h 275
myFormPanelWindow
;

//form layout
formLayout myFormForm;

//----- content
modelPanel -mbv 0 -cam "persp" myPanelPanel;
$currentModelPanel = `modelPanel -q -modelEditor myPanelPanel`;
modelEditor -e -cam "persp" -allObjects 0 -grid 0 -nurbsSurfaces 1 -dimensions 1 $currentModelPanel;
setParent ..;

button -l "Left Button" LeftButton;
button -l "Right Button" RightButton;
//----- end content

//modelEditor -e -interactive myModelEditor;

formLayout -edit
-attachForm myPanelPanel top 0
-attachForm myPanelPanel left 0
-attachForm myPanelPanel right 0
-attachForm myPanelPanel bottom 25

-attachControl LeftButton top 2 myPanelPanel
-attachForm LeftButton left 0
-attachPosition LeftButton right 2 50
-attachForm LeftButton bottom 2

-attachControl RightButton top 2 myPanelPanel
-attachControl RightButton left 2 LeftButton
-attachForm RightButton right 0
-attachForm RightButton bottom 2

//Form
myFormForm
;

showWindow myFormPanelWindow;
}

CGTalk Moderation
03-29-2008, 05:10 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.