how to detect an interrupted render...

Hello I have made a plugin for blender wich generate multiple cameras arround a specified target. Then I make renders for each camera using a bucle… I would like detect when a render has been interrupted, this way i could break the bucle. But in this moment I don’t have any idea about how do this, and the only way I have to cancel the process is pressing ESC key for each camera.

If anyone know how solve this problem, please write me.

A lot of thanks!

I dont think theres any way of knowing, but the API should support it,.

Ill try see if the function can return True/False based on weather its canceled or not

What is a ‘bulce’

I have made a bucle… something like this:

for i in (0,number_cams):
renderProcess()

then, when i cancel by pressing esc one of these renders, the program continue with the next camera render… and i only can cancel the process completely pressing esc one time per camera.

I have look for render method especification of RenderData class but it don’t return nothing…

Thanks another time

bucket? .

jesusdz, currently the API dosnt support it.
if youre rendering an animation you could get the script to check that an image exists from the current frame. if not the render was canceled.

just thinking about it and this is a good way…

backup the start end frames.
set the start and end frames to be the same- so rendering an animation only renders 1 image.

Then render the animation. this will automaticly save the image (unlike a still which requires you to do it after rendering)

if the image dosnt exist avter rendering then it was canceled…

  • after that works add some error checking, cos teh file bay be there before… if thats the case remove it or check its time/date stamp to make sure its been touched.

Another way I havnt looked into- if you rendering stills then saving. is the save render may raise an exception of the render was inturrupted… then you can use exception handeleing to work that out.

Thanks a lot!

I’ve completed the task using the method you say me. Instead use render() function, i’ve used renderAnim() with startFrame and endFrame located in 1. This generates <<numframe>>.png image in my output render directory. When the render is finished I change the name with the name I want. If the render is cancelled, <<numframe>>.png isn’t created and then i can raise an exception :D.

It would be better another more clean solution… but at least this runs well!

Thanks another time.