dropAttrWindow; которая будет благополучно вызывать процедуру создания окна, сохраненную на диске в файле dropAttrWindow.mel. Но тогда придется вместе со сценой таскать еще и этот файл, что рано или поздно приведет к путанице.
Поэтому проще и удобнее скопировать в поле Script: все содержимое файла dropAttrWin-dow.met и дополнить его в конце вызовом команды dropAttrWindow:
global proc dropAttrWindow()
{
iff'window -ex DROP_WINDOW'==1) { deleteUI DROP_WINDOW; }
window -t “drop attributes" DROP_WINDOW;
columnLayout;
frameLayout -I "push Field Attributes" -ell 1; columnLayout; attrFieldSliderGrp -at pushField.mag -min 0 -max 50; attrFieldSliderGrp -at pushField.att -min 0 -max 4 ; attrFieldSliderGrp -at pushField.max -min 0 -max 10 ; setParent..; setParent..;
frameLayout -I “pull Field Attributes" -ell 1; columnLayout; attrFieldSliderGrp -at pullField.mag -min -50 -max 0; attrFieldSliderGrp -at pullField.att -min 0 -max 4 ; attrFieldSliderGrp -at pullField.max -min 0 -max 10 ; setParent..; setParent ..;
frameLayout -I “pull Field Attributes” -ell 1; columnLayout;
attrFieldSliderGrp -at drop.con -min 0 -max 1; setParent..; setParent
separator-style "none” -h15;
gridLayout -numberOfColumns 4 -cellWidthHeight 96 32; button -I “Reset” -w 94 -c “resetAU”; button -I “Save” -w 94 -c “saveAll”; button -I “Load” -w 94 -c “loadAll”;
button -I “Close” -w 94 -c “deleteUI DROP_WINDOW;” ;setParent..; showWindow DROP.WINDOW;
}
////////////////////////////////////////////////////////// global proc resetAll()
{
setAttr "pushField.magnitude” 39; setAttr "pushField.attenuation” 4; setAttr “pushField.maxDistance” 2; setAttr “pullField.magnitude” -6; setAttr “pullField.attenuation" 4; setAttr “pullField.maxDistance” 5; setAttr “dropShape.conserve” 0.9;
}
liltllliitlliiiitttitttttillllllllllUltlliiHIIIIiiiitni global proc saveAll()
{
string SfileName = 'fileDialog -dm “c:/temp/” int SfileNumber = 'fopen SfileName “w” '; fprint SfileNumber ('getAttr "pushField.magnitude” W\n"); fprint SfileNumber {'getAttr “pushField.attenuation" '+”\r\n”);
fprint SfileNumber ('getAttr “pushField.maxDistance” '+”\r\n”); fprint SfileNumber ( getAttr “pullField.magnitude” +”\r\n”); fprint SfileNumber ( getAttr “pullField.attenuation” ’+”\r\n”); fprint SfileNumber ( getAttr “pullField.maxDistance” '+”\r\n”); fprint SfileNumber ( getAttr “dropShape.conserve” '+”\r\n”); fclose SfileNumber;
}
////////////////////////////////////////////////////////// global proc loadAll()
I ,
string SfileName = fileDialog -dm “c:/temp/” ; int SfileNumber = 'fopen SfileName “r” ’; float Svalue;
Svalue = ’ fgetline SfileNumber' ; setAttr “pushField.magnitude” Svalue ;
Svalue = ' fgetline SfileNumber" ; setAttr “pushField.attenuation” Svalue ;
Svalue = ' fgetline SfileNumber' ; setAttr “pushField.maxDistance” Svalue ;
Svalue = ' fgetline SfileNumber' ; setAttr “pullField.magnitude” Svalue ;
Svalue = ' fgetline SfileNumber' ; setAttr “pullField.attenuation” Svalue ;
Svalue = ' fgetline SfileNumber' ; setAttr “pullField.maxDistance” Svalue ;