PDA

View Full Version : About progressWindow


safakoner
12-06-2003, 12:33 PM
Hi

I learnd about progressWindow command from help. But I don't know how can I run this code during an procedure. I can't find an example on internet.

Can you help me about it ?
Thanks

---------------------------------------

waitCursor -state on;
global proc calculatep ()
{

int $amount = 0;

progressWindow
-title "Calculating... Please Wait..."
-progress $amount
-status "Sleeping: 0%"
-isInterruptable true;

while (true) {

if ( `progressWindow -query -isCancelled` ) break;
if ( `progressWindow -query -progress` >= 100 ) break;
$amount += 100;
progressWindow -edit
-progress $amount
-status ("Percent: "+$amount+"%");
pause -seconds 1;
}

progressWindow -endProgress;

}
calculatep;
waitCursor -state off;

Doogie
12-07-2003, 01:04 AM
Try changing $amount += 100; to something like $amount += 20; (100% / 20 means the progress bar will last 5 seconds)

hopefully explaining the major commands will help you to use this in your own scripts:
waitCursor -state on; // turns on the hourglass
progressWindow; // pops up the progress window
if ( `progressWindow -query -isCancelled` ) break; // checks to see if you pressed escape
if ( `progressWindow -query -progress` >= 100 ) break; // checks to see if it reached 100%
progressWindow -edit; // updates the window
pause -seconds 1; // pauses for 1 second
progressWindow -endProgress; // closes the window
waitCursor -state off; // turns off the hourglass



Lets say you wanted to import a character 300 times in to the scene ($i is however many youve imported so far and $total is the final number you wanna import). You'd write something like progressWindow -e -progress `trunc($i / $total * 100)`;

CGTalk Moderation
01-16-2006, 09:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.