Exit / Escape / Quit a running script

Hey,
I have a script that renders out a number of images, one by one as single images, not a frame range or stuff like that. It changes some texture maps and says max quick render in the last of three nested for loops. So lets say when testing the script, I want it to start and maybe render 1 or 2 images and then I want to stop it. Right now I have to cancel each rendering manually by clicking on the "Cancel" button. The script is meant to render hundreds of images, so that will not be a nice way of quitting script execution...

Is there any way to end the script, e.g. by pressing the escape button for 5secs or so? Maybe there is a callback for this, butI have to get out of the for-loop, and I dont know how.

Cheers

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
br0t's picture

sounds good to me, I will try

sounds good to me, I will try that! Thanks, also for your continuing help even in some of my pretty old threads, I havent had the time to answer some of them yet so I do it here: thanks ;)

Never get low & slow & out of ideas

Swordslayer's picture

My pleasure :)

My pleasure :)

Swordslayer's picture

I'd say the most common way

I'd say the most common way of exiting the for-loop this way is using something like if keyboard.escPressed do exit inside the loop or just for i = 1 to ... while NOT keyboard.escPressed do .... Of course this condition is checked only at the start of each iteration so it only makes sense to hold the escape key at that time...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.