jgibz
04-24-2006, 06:32 PM
Hi everyone,
I've been working on this script for setting up a character rig. At one point a new window is created within a procedure which requires the use of a string variable declared within the same procedure. The problem is, the window pops up and the procedure keeps running, as it's called by a button command from the original script UI. So the string the window needs not only no longer exists by the time the user interacts with the new window, but the changes the new pop-up window is supposed to make are obsolete, as it is supposed to effect objects before the procedure finishes.
So is there a way to pause a preocedure, or stop it from evaluating until the pop-up window is closed?
an example... global proc test()
{
string $neededString = "needed";
float $neededFloat;
string $newWindow = `window -title "window1"`;
columnLayout;
floatSliderGrp -label "size"
-field true
-value 0
-minValue -10 -maxValue 10
rowLayout;
button -label "scale now" -command "$neededFloat = `floatSliderGrp -q -value myWin`; setAttr ($needeString + \".scale\") $neededFloat $neededFloat $neededFloat" myWin;
showWindow $newWindow;
}
clicking the button results in...
// Error: $neededFloat = `floatSliderGrp -q -value myWin`; setAttr ($needeString + ".scale") $neededFloat $neededFloat $neededFloat; //
// Error: "$needeString" is an undeclared variable. //
does anyone know how to fix this?
I've been working on this script for setting up a character rig. At one point a new window is created within a procedure which requires the use of a string variable declared within the same procedure. The problem is, the window pops up and the procedure keeps running, as it's called by a button command from the original script UI. So the string the window needs not only no longer exists by the time the user interacts with the new window, but the changes the new pop-up window is supposed to make are obsolete, as it is supposed to effect objects before the procedure finishes.
So is there a way to pause a preocedure, or stop it from evaluating until the pop-up window is closed?
an example... global proc test()
{
string $neededString = "needed";
float $neededFloat;
string $newWindow = `window -title "window1"`;
columnLayout;
floatSliderGrp -label "size"
-field true
-value 0
-minValue -10 -maxValue 10
rowLayout;
button -label "scale now" -command "$neededFloat = `floatSliderGrp -q -value myWin`; setAttr ($needeString + \".scale\") $neededFloat $neededFloat $neededFloat" myWin;
showWindow $newWindow;
}
clicking the button results in...
// Error: $neededFloat = `floatSliderGrp -q -value myWin`; setAttr ($needeString + ".scale") $neededFloat $neededFloat $neededFloat; //
// Error: "$needeString" is an undeclared variable. //
does anyone know how to fix this?
