Render.ru

Написание UI с помощю МЕЛ

DEL

Активный участник
Рейтинг
15
#1
Привет.
Написал два сценария ползовательского интерфейса.Один с кнопками ИК_ФК переключателя и другой-слайдеры для пальцев персонажа. Но никак не могу обьеденить их в один, так что бы оба появились в одном окне в разных закладках. вот они :

window Zangano;
scrollLayout;

//кнопки

frameLayout -collapsable true -label "Brazo Izq superior";
columnLayout -adjustableColumn true;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff1";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon1";


frameLayout -collapsable true -label "Brazo Der Superior";
columnLayout -adjustableColumn true;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff2";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon2";

frameLayout -collapsable true -label "Brazo Izq Inferior";
columnLayout -adjustableColumn true;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff3";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon3";


frameLayout -collapsable true -label "Brazo Der Inferior";
columnLayout -adjustableColumn true;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff4";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon4";


//слайдеры

frameLayout -collapsable true -label "Pulgar" -width 450;
columnLayout -adjustableColumn true;

attrFieldSliderGrp -min -100 -max 100 -at "PulgarIZQ_SUP.rx";
attrFieldSliderGrp -min -100 -max 100 -at "PulgarIZQ_SUP.ry";
attrFieldSliderGrp -min -100 -max 100 -at "PulgarIZQ_SUP.rz";
attrFieldSliderGrp -min -100 -max 100 -at "PulgarIZQ_SUP1.ry";

frameLayout -collapsable true -label "Indice" -width 450;
columnLayout -adjustableColumn true;

attrFieldSliderGrp -min -100 -max 100 -at "IndizqIZQ_SUP.ry";
attrFieldSliderGrp -min -100 -max 100 -at "IndizqIZQ_SUP.rz";

attrFieldSliderGrp -min -100 -max 100 -at "IndizqIZQ_SUP1.ry";
attrFieldSliderGrp -min -100 -max 100 -at "IndizqIZQ_SUP1.rz";

attrFieldSliderGrp -min -100 -max 100 -at "IndizqIZQ_SUP1|IndizqIZQ_SUP2.ry";
attrFieldSliderGrp -min -100 -max 100 -at "IndizqIZQ_SUP1|IndizqIZQ_SUP2.rz";



frameLayout -collapsable true -label "Medio" -width 450;
columnLayout -adjustableColumn true;

attrFieldSliderGrp -min -100 -max 100 -at "MedioIZQ_SUP.ry";
attrFieldSliderGrp -min -100 -max 100 -at "MedioIZQ_SUP.rz";

attrFieldSliderGrp -min -100 -max 100 -at "MedioIZQ_SUP1.ry";
attrFieldSliderGrp -min -100 -max 100 -at "MedioIZQ_SUP1.rz";

attrFieldSliderGrp -min -100 -max 100 -at "MedioIZQ_SUP2.ry";
attrFieldSliderGrp -min -100 -max 100 -at "MedioIZQ_SUP2.rz";



frameLayout -collapsable true -label "Menique" -width 450;
columnLayout -adjustableColumn true;

attrFieldSliderGrp -min -100 -max 100 -at "MeniqueIZQ_SUP.ry";
attrFieldSliderGrp -min -100 -max 100 -at "MeniqueIZQ_SUP.rz";

attrFieldSliderGrp -min -100 -max 100 -at "MeniqueIZQ_SUP1.ry";
attrFieldSliderGrp -min -100 -max 100 -at "MeniqueIZQ_SUP1.rz";

attrFieldSliderGrp -min -100 -max 100 -at "MeniqueIZQ_SUP2.ry";
attrFieldSliderGrp -min -100 -max 100 -at "MeniqueIZQ_SUP2.rz";

showWindow Zangano;

//процедуры для кнопок

proc IKoff1 () {
getAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 ;
setAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 0;
};

proc IKon1 () {
getAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 ;
setAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 10;
};
proc IKoff2 () {
getAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 ;
setAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 0;
};

proc IKon2 () {
getAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 ;
setAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 10;
};
proc IKoff3 () {
getAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 ;
setAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 0;
};

proc IKon3 () {
getAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 ;
setAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 10;
};

proc IKoff4 () {
getAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 ;
setAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 0;
};

proc IKon4 () {
getAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 ;
setAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 10;
};

И еще одна проблема. Когда сворачиваю верхнюю вкладку то все нижние(сколько бы их небыло)
тоже сворачиваются под первым.
Смотрел в хелпе.Там все раставленно по полкам со своими примерами про обе команды frameLayout и tabLayout. Но на практике никак не смог использовать.


Спасибо.
 

DEL

Активный участник
Рейтинг
15
#2
Теперь задам вопрос вот так : Что я делаю не правильно?

Написаный мной скрипт


window -widthHeight 200 150;
string $tabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;


string $child1 = `rowColumnLayout`;
frameLayout -collapsable true -label "Brazo Izq superior";
rowColumnLayout ;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff1";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon1";


frameLayout -collapsable true -label "Brazo Der Superior";
rowColumnLayout ;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff2";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon2";

frameLayout -collapsable true -label "Brazo Izq Inferior";
rowColumnLayout ;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff3";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon3";


frameLayout -collapsable true -label "Brazo Der Inferior";
rowColumnLayout;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff4";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon4";

setParent ..;







string $child2 = `rowColumnLayout`;
frameLayout -collapsable true -label "Brazo Izq superior";
rowColumnLayout -adjustableColumn true;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "Pulgar" -command "PUL";
setParent ..;


tabLayout -edit
-tabLabel $child1 "Ikfk" -tabLabel $child2 "Dedosel"
$tabs;
showWindow;





proc IKoff1 () {
getAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 ;
setAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 0;
};

proc IKon1 () {
getAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 ;
setAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 10;
};
proc IKoff2 () {
getAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 ;
setAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 0;
};

proc IKon2 () {
getAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 ;
setAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 10;
};
proc IKoff3 () {
getAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 ;
setAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 0;
};

proc IKon3 () {
getAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 ;
setAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 10;
};

proc IKoff4 () {
getAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 ;
setAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 0;
};

proc IKon4 () {
getAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 ;
setAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 10;
};




proc PUL () {

select -r PulgarIZQ_SUP_CTRL1 ;
autoUpdateAttrEd;
statusLineUpdateInputField;
select -tgl PulgarIZQ_SUP_CTRL2 ;
autoUpdateAttrEd;
statusLineUpdateInputField;

};



Найденый в хелпе пример (выкинул вещи которые мне не нужны):



window -widthHeight 200 150;
string $tabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;


string $child1 = `rowColumnLayout -numberOfColumns 2`;
button; button; button;
setParent ..;

string $child2 = `rowColumnLayout -numberOfColumns 2`;
button; button; button;
setParent ..;

tabLayout -edit
-tabLabel $child1 "One" -tabLabel $child2 "Two"
$tabs;

showWindow;


Дело в том , что приме р из хелпа функционирует, а при осполнении моего выдает вот это :

// Error: Too many children in layout: frameLayout20
 

DEL

Активный участник
Рейтинг
15
#3
Однако исполив вот этот скрипт все идет нормально(викидывая вторую закладку), появляется окно с одной закладкой.


window -widthHeight 200 150;
string $tabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;


string $child1 = `rowColumnLayout`;
scrollLayout;
frameLayout -collapsable true -label "Brazo Izq superior";
rowColumnLayout ;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff1";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon1";


frameLayout -collapsable true -label "Brazo Der Superior";
rowColumnLayout ;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff2";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon2";

frameLayout -collapsable true -label "Brazo Izq Inferior";
rowColumnLayout ;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff3";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon3";


frameLayout -collapsable true -label "Brazo Der Inferior";
rowColumnLayout;

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKOFF" -command "IKoff4";

iconTextButton -style "iconAndTextHorizontal"
-image "Zangano.xpm" -label "IKON" -command "IKon4";

setParent ..;

tabLayout -edit
-tabLabel $child1 "Ikfk"
$tabs;
showWindow;

proc IKoff1 () {
getAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 ;
setAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 0;
};

proc IKon1 () {
getAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 ;
setAttr Munyeca_IZQ_SUP_FK.IK_FK_INTERRUPTOR1 10;
};
proc IKoff2 () {
getAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 ;
setAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 0;
};

proc IKon2 () {
getAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 ;
setAttr Munyeca_DER_GIR_SUP.IK_FK_INTERRUPTOR2 10;
};
proc IKoff3 () {
getAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 ;
setAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 0;
};

proc IKon3 () {
getAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 ;
setAttr Munyeca_IZQ_INF_FK.IK_FK_INTERRUPTOR3 10;
};

proc IKoff4 () {
getAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 ;
setAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 0;
};

proc IKon4 () {
getAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 ;
setAttr Munyeca_DER_GIR_INF.IK_FK_INTERRUPTOR4 10;
};
 
Сверху