FormLayout Height, weird Margin appear [MEL]


#1

Hi there ! This is my first post here !
So, I’m a begginer in MEL and I’ve got this problem I can"t solved.
I decided to create a Picker for my latest Rig, it’s my first Picker ever so I wanted to keep things simple ! I have 2 tabs for facial and body picker, plus some buttons next to it to select or switch IK:FK
From there, everything seems to work perfectly, except : the formLayout seems to need Height and Width value (because it’s too small), width seems to work perfectly, but as soon as I put height, the all formLayout move to the bottom ! (it’s looking like it’s moving putting half the height value as a top margin)
I’m using a formLayout so I can put my buttons wherever I want, and the margin just appeared for no reason, and I don’t know why ! :frowning:
I had to make the tab bigger to see what I was doing ! Also i took off some of the buttons so it’s not too long, the problem was already there with the first button.
There is a screen plus my script, I hope you can help me!
Thank you so much,
Marinc

if (window -exists $myWin)
{
deleteUI $myWin;
}

proc Stitch_Rig()
{

string $myWin = `window  -t "STITCH PICKER" -wh 500 450 "winRigStitch"`;
float $colorCenter[] = {1.0, 0.874, 0.239};
float $colorRoot[] = {0.470, 0.643, 0.254};
float $colorRight[] = {0.211, 0.435, 0.988};
float $colorLeft[] = {0.988, 0.211, 0.317};
float $colorLeft2[] = {0.8, 0.180, 0.266};
float $colorRight2[] = {0.145, 0.321, 0.756};

        columnLayout ;
            text -l "STITCH PICKER" -al "center" -h 30 -w 500 "textStitch";
                rowLayout -nc 2;
                    columnLayout -w 100 -rs 10;
                        button -w 100 -h 35 -l "IK/FK Arm Left" -c "polySphere; select -d;" "button1";
                        button -w 100 -h 35 -l "IK/FK Arm Right" -c "polySphere; select -d;" "button2";
                        button -w 100 -h 35 -l "IK/FK Leg Left" -c "polySphere; select -d;" "button3";
                        button -w 100 -h 35 -l "IK/FK Leg Right" -c "polySphere; select -d;" "button4";
                        button -w 100 -h 35 -l "Key All" -c "setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 0 {\"CTRL_*\"};" "button5"; //setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 0 {"CTRL_*"};
                        button -w 100 -h 35 -l "Select All" -c "select -r \"CTRL_*\";" "button6";
                        setParent ..;
                    tabLayout -w 390 -h 560;
                        shelfLayout "Body";
                            formLayout -numberOfDivisions 100 -w 390 -h 400 "LayoutBody";
                            string $image = `image -i "PERSO/stitch_fond.png"`;
                            string $b1 = `button -bgc $colorCenter[0] $colorCenter[1] $colorCenter[2] -w 100 -h 20 -l "Head" -c "select -r CTRL_Head ;" "ButtonHead"`;
                            string $b2 = `button -bgc $colorLeft[0] $colorLeft[1] $colorLeft[2] -w 70 -h 20 -l "Ear L" -c "select -r CTRL_Ear_Left_03 ;" "ButtonEarL01"`;
                            string $b3 = `button -bgc $colorLeft[0] $colorLeft[1] $colorLeft[2] -w 70 -h 20 -l "Ear L" -c "select -r CTRL_Ear_Left_02 ;" "ButtonEarL02"`;
                            string $b4 = `button -bgc $colorLeft[0] $colorLeft[1] $colorLeft[2] -w 70 -h 20 -l "Ear L" -c "select -r CTRL_Ear_Left_01 ;" "ButtonEarL03"`;
                        
                              formLayout -edit
                                -attachForm     $b1 "top" 65
                                -attachForm     $b1 "left" 147
                                -attachForm     $b2 "top" 25
                                -attachForm     $b3 "top" 60
                                -attachForm     $b4 "top" 95
                                -attachForm     $b2 "left" 265
                                
                                
                                "LayoutBody";
                                setParent ..;
                            setParent ..;
                        shelfLayout "Face";
                            setParent ..;

showWindow $myWin; } 

Stitch_Rig();