global proc shavetorib () { global string $ar_pescpath; if ((`window -ex shavetoribWin`) == true) { deleteUI shavetoribWin; windowPref -remove shavetoribWin; } window -t ("Export Shave To Rib") -w 560 -h 360 -s 1 shavetoribWin; columnLayout ; separator -height 40 -w 550 -style "out"; text -width 560 -label "Export Shave To Rib" -align "center";; //separator -height 40 -w 550 -style "out"; rowColumnLayout -numberOfColumns 3 -columnAttach 1 "left" 0 -columnWidth 1 100 -columnWidth 2 350; text -label "Output Name"; textField -width 350 shaveselectriboutput; textField -edit -enterCommand ("setFocus") shaveselectriboutput; textField -edit -text (`workspace -fn`+"/MTOR_RIBArchive/shave.rib") shaveselectriboutput; button -label "Browse" -command ("fileBrowserDialog -m 2 -fc \"ar_up_scr_path\" -an \"select\"") -align "center"; setParent ..; separator -height 40 -w 560 -style "out"; rowColumnLayout -numberOfColumns 2 -columnWidth 1 275 -columnWidth 2 275; frameLayout -height 140 -label "Animation" -annotation "Export sequence of files" -collapsable 0 animmenu ; rowColumnLayout -numberOfColumns 1 -columnWidth 1 265; checkBox -label "Enable" -align "left" -value 0 -changeCommand "enableAnimation" ExportAnim; rowColumnLayout -numberOfColumns 2 -columnWidth 1 130 -columnWidth 2 130 animcontrols;; text -label "Start Frame" ; text -label "End Frame"; intField -value `playbackOptions -q -minTime` -enable 0 startFrame; intField -value `playbackOptions -q -maxTime` -enable 0 endFrame; setParent..; rowColumnLayout -numberOfColumns 1 -columnWidth 1 260; button -width 160 -align "center" -label "Get Timeline Range" - c "ar_get_time_range" -enable 0 gettime; setParent ..; setParent ..; setParent ..; frameLayout -h 140 -w 270 -label "Rat Setup" -annotation "setup slim pallete" -collapsable 0 deletefile ; columnLayout; button -label "Make RibBox" -h 20 -w 270 -c "ar_makeribbx"; setParent ..; setParent ..; setParent ..; rowColumnLayout -numberOfColumns 1 -columnWidth 1 550; //separator -height 40 -w 550 -style "out"; //separator -height 40 -w 550 -style "out"; button -label "GO!" -h 50 -c "ar_exportribcmd"; showWindow shavetoribWin; }; global proc ar_get_time_range() { intField -edit -value `playbackOptions -q -minTime` startFrame; intField -edit -value `playbackOptions -q -maxTime` endFrame; }; global proc enableAnimation() { int $state = `checkBox -query -value ExportAnim`; if ($state == 0) {textField -edit -enable 0 startFrame; textField -edit -enable 0 endFrame; button -edit -enable 0 gettime; } else {textField -edit -enable 1 startFrame; textField -edit -enable 1 endFrame; button -edit -enable 1 gettime;} } global proc ar_up_scr_path(string $pathname,string $pathtype) { textField -edit -text ($pathname+".rib") shaveselectriboutput; }; global proc ar_exportribcmd() { float $Start_Frame = `textField -q -tx startFrame`; float $End_Frame = `textField -q -tx endFrame`; global int $range; $range=`checkBox -query -value ExportAnim`; if ($Start_Frame >= $End_Frame){ error ("correct end Frame");} for ($start = ($Start_Frame); $start <= ($End_Frame); $start ++) { if($range==1) {currentTime $start ;}; float $currTime = `currentTime -q `; string $buffer[]; string $outribname = `textField -q -text shaveselectriboutput`; $numTokens = `tokenize $outribname "." $buffer`; shaveWriteRib -vc -sn ($buffer[0]+"."+$currTime+".rib"); if ($range==0) break; } } ; global proc ar_makeribbx() { loadmtor; }; global proc loadmtor() { string $plugs= "mtor"; if ( !`pluginInfo -q -l $plugs`){ error "Can't load mtor plugin."; } }; global proc createshavelocator() { if(!`objExists shaveArchiveRib` ) {string $createloc = "spaceLocator -p 0 0 0;"; string $locnam[] =`eval $createloc`; rename ($locnam) "shaveArchiveRib";} else {select -r shaveArchiveRib ; ;} }; shavetorib;