PDA

View Full Version : Delaying a Mel Script


Immortal1490
11-24-2005, 08:45 PM
Is there anyway to make a script sleep for a certain amount of time before continuing?

For instance, if I wanted a script to make the selected object move 10 times, (once every second). I could do something like this:

$x = 0;
while ($x < 10){
wait 1;
move -r -1 0 0 ;
$x = $x + 1;
}

I know wait 1; does nothing, but is there something that would stall the script for a certain amount of time?

goleafsgo
11-24-2005, 09:33 PM
Have you tried the "pause" command?

Immortal1490
11-24-2005, 09:53 PM
the problem with that is, I want to be able to see the movement. With the pause command, it just waits a certain amount of time without showing what it has done so far.

goleafsgo
11-25-2005, 01:04 PM
You could put a refresh call before the pause.
Something like this...


{
int $i;
for ($i=0; $i<30; $i+=5)
{
polySphere;
move -r 0 0 $i;
refresh -f;
pause -sec 1;
}
}

CGTalk Moderation
11-25-2005, 01:04 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.