View Full Version : What m I doing wrong???
nottoshabi 08-09-2003, 08:28 PM Can anyone tell me what I'm doing wrong??:curious:
if(`window -ex "Gramps Facial"`)
deleteUI Gramps Facial;
window -widthHeight 500 450 -title "Gramps Facial";
columnLayout -adjustableColumn true;
string $form = `formLayout`;
string $tabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;
formLayout -edit
-attachForm $tabs "top" 0
-attachForm $tabs "left" 0
-attachForm $tabs "bottom" 0
-attachForm $tabs "right" 0
$form;
string $child1 = `rowColumnLayout -numberOfColumns 2`;
floatSliderGrp -label "Blahh";
floatSliderGrp -min 1 -max 10 -value 1;
floatSliderGrp -label "Puhh" ;
floatSlider -min 1 -max 10 -value 1;
button -label "Key";
setParent ..;
string $child2 = `rowColumnLayout -numberOfColumns 2`;
floatSliderGrp -label "Mad";
floatSlider -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Surprised";
floatSlider -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Frawn";
floatSlider -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Close Right";
floatSlider -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Close Left";
floatSlider -min 1 -max 10 -value 1 -step 1;
button -label "Key";
setParent ..;
tabLayout -edit
-tabLabel $child1 "Mouth" -tabLabel $child2 "Eyes"
$tabs;
showWindow;
|
|
boraddd
08-09-2003, 09:01 PM
Line#1 2 3 are wrong.. the rest is fine.. replace first 3 lines with
if(`window -ex grampsFacial`)
deleteUI grampsFacial;
window -widthHeight 500 450 -title "Gramps Facial" grampsFacial;
bigfatMELon
08-09-2003, 09:02 PM
Is there an error message? What is the wrong with your result? This runs on my end. Looks ugly as hell, but it runs.
-jl
nottoshabi
08-09-2003, 11:09 PM
Thanks Boraddd but that does not fix the problem.
BigfatMeLon the problem that I'm having is that the slider the name of the slider and the little box that displays the numbers are all overlaping and I dont understand y.
The name needs to start from the right, then the little box that displays the numbers, and then the slider, all on the same line. It needs to be the same on both tabs.
I can do it individualy but when I put it in this set up it acts like this and I dont know y.
dmcgrath
08-10-2003, 10:20 PM
Here you go.
Now when you call on the window it will delete the old one properly.
You didn't need a rowColumnLayout, so I made it just a columnLayout.
And you were trying to stack floatSliders on top of one another, you only need the single slider and put all relevant commands down into it.
if(`window -ex grampsFacial`)
{
deleteUI grampsFacial;
}
window -widthHeight 500 450 -title "Gramps Facial" grampsFacial;
columnLayout -adjustableColumn true;
string $form = `formLayout`;
string $tabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;
formLayout -edit
-attachForm $tabs "top" 0
-attachForm $tabs "left" 0
-attachForm $tabs "bottom" 0
-attachForm $tabs "right" 0
$form;
string $child1 = `columnLayout`;
floatSliderGrp -label "Blahh" -field true -min 1 -max 10 -value 1;
floatSliderGrp -label "Puhh" -field true -min 1 -max 10 -value 1;
button -width 60 -label "Key";
setParent ..;
string $child2 = `columnLayout`;
floatSliderGrp -label "Mad" -field true -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Surprised" -field true -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Frown" -field true -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Close Right" -field true -min 1 -max 10 -value 1 -step 1;
floatSliderGrp -label "Close Left" -field true -min 1 -max 10 -value 1 -step 1;
button -width 60 -label "Key";
setParent ..;
tabLayout -edit
-tabLabel $child1 "Mouth" -tabLabel $child2 "Eyes"
$tabs;
showWindow grampsFacial;
p.s. I also changed "Frawn" to "Frown" :beer:
dmcgrath
08-10-2003, 10:27 PM
I also should let you know that your button won't do anything yet. But you probably know that.
nottoshabi
08-11-2003, 08:17 PM
Thanks for everything Dmcgrath it works great now.
I know about the buttons, I just did not wanted to start connecting things untill I got the UI to display nicely.
Speaking of connections:
How do I connect an object that is on a path attached by a geometry constraint to the slider. So that when the slider is at 0 the object is at a perticular spot and when the slider is at 10 the object is at a different spot. Also this obect does not travel in only one axis. But it will only translate never rotate or scale?
Once again thanks for all your help. :buttrock:
dmcgrath
08-11-2003, 08:54 PM
http://cade.scope.edu/courseware/notes/mel/index.html
This is the best quick immersion for MEL UI design. I think there is also some stuff about connecting things.
I think you have to connect the -dragCommand to your slider, but I'm not sure how to.
-OR-
You might want to modify your slider to an attrFieldSliderGrp
Then use the command -attribute and connect it directly to the slider, if that's all you need. I remember doing something like this in my MEL class last year, I'll copy and paste it for you to show you what I mean. I modified it a little so you can just run it and see what happens.
if (`window -exists sphereTransWin1`)
{
deleteUI sphereTransWin1;
}
polySphere -n sphere1;
window -width 300 -height 300 -title "Sphere Controls" sphereTransWin1;
columnLayout;
attrFieldSliderGrp -min 0 -max 10
-attribute sphere1.translateX
-label "translateX";
attrFieldSliderGrp -min 0 -max 10
-attribute sphere1.translateY
-label "translateY";
attrFieldSliderGrp -min 0 -max 10
-attribute sphere1.translateZ
-label "translateZ ";
showWindow sphereTransWin1;
CGTalk Moderation
01-15-2006, 08:00 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.