  | | | Script run from button slowdown | Script run from button slowdown 2003-11-26 - By Andy Walker
Back I'm running a mel script executed by a button. The script bakes a polygon mesh every frame. Without thte GUI, the script takes 5 seconds a frame. With the GUI it takes 30 seconds. Same script, just with a button instead of command line execution.. very odd.
Has anyone else had this trouble? The GUI script is below. This is the specific command:
button -label Ok -c ( "bakePoly " + "`intFieldGrp -query -value1 start`" + " " + "`intFieldGrp -query -value1 end`" + " " + "`optionMenuGrp -q -v rig`" + ";\n" + "deleteUI -window bakePolyGUI;\n" ) ok;
Cheers,
Andy.
===============================
//Andy Walker. 19/11/03. GUI for bakePoly.
global proc int bakeChainPolyGUI() {
source bakeChainPoly;
if (`window -exists bakePolyGUI`) deleteUI bakePolyGUI; int $bakeStart; int $bakeEnd; string $rig = "anim"; window -iconName "bakePolyGUI" -title "bakePoly GUI" -widthHeight 100 100 bakePolyGUI; formLayout humdrum; intFieldGrp -numberOfFields 1 -label Start -cw 1 40 start; intFieldGrp -numberOfFields 1 -label End -cw 1 40 end; optionMenuGrp -cw 1 40 -label Rig rig; menuItem -label "anim"; menuItem -label "anim62"; menuItem -label "anim73"; menuItem -label "muscle";
button -label Ok -c ( "bakePoly " + "`intFieldGrp -query -value1 start`" + " " + "`intFieldGrp -query -value1 end`" + " " + "`optionMenuGrp -q -v rig`" + ";\n" + "deleteUI -window bakePolyGUI;\n" ) ok;
button -label Cancel -command "deleteUI -window bakePolyGUI" cancel;
formLayout -edit -attachForm start "top" 5 -attachPosition start "left" 0 5 -attachOppositeControl end "top" 25 start -attachPosition end "left" 0 5
-attachOppositeControl rig "top" 25 end -attachPosition rig "left" 0 5 -attachOppositeControl ok "top" 40 rig -attachPosition ok "left" 0 5 -attachOppositeControl cancel "top" 40 rig -attachOppositeControl cancel "left" 25 ok humdrum; showWindow bakePolyGUI; return 0; }
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-unsubscribe: <http://www.highend3d.com/maya/listserver/> List-subscribe: <http://www.highend3d.com/maya/listserver/> List-archive: <http://www.highend3d.com/maya/archive/>
|
|
 |