PDA

View Full Version : progressBar and sleep


relief7
05-06-2008, 04:24 PM
Hi,

I have this small script where I want to delay the execution of a rendering (with sleep) and I would like to use a progressBar as an indicator for when the rendering actually starts (see script).


iSeconds = 3

progressStart "test"

for i = 1 to iSeconds do
(
format "starting in % sec...\n" ( iSeconds - iSecondsWaited )
sleep 1

progressUpdate ( i / iSeconds * 100.0 )
)

progressEnd()

But it seems that neither the progress bar nor any of the viewports are being updated within the for-loop. If I replace the sleep by something else that takes a little time (like a math. calculation) it works like a charm. It would be nice to have some visual feedback though. Does anybody have an idea what is wrong here ? I am on MAX 9 64 Bit.

davestewart
05-06-2008, 04:35 PM
It might be worth looking at the timer UI item instead of a for loop with sleep.

relief7
05-06-2008, 05:08 PM
cool thanks for the tip ! I have got it working with a timer item... still I am curious why the sleep function seems to not only block i/o while it is running but also while it is not running.

CGTalk Moderation
05-06-2008, 05:08 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.