Interrupting script crashes Blender

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
metaphorz
Posts: 21
Joined: Sun Nov 10, 2002 3:20 am

Interrupting script crashes Blender

Post by metaphorz »

I am doing rendering in a python script that I
wrote, by setting the start frame/end frame, and
so forth. It works fine as long it goes to completion.

The problem is that when I try to stop it by going to
the DOS window and typing Ctrl-C, it does stop the
script with a "keyboard interrupt"; however, when
I then click on the Blender window, I get a windows
crash report ("this application will now close....').

Being able to temporrily halt a rendering in mid-stream
is useful if, for example, I realize that I have the wrong
setting for a variable.

Is there a way around the crash?

metaphorz
Posts: 21
Joined: Sun Nov 10, 2002 3:20 am

partial solution

Post by metaphorz »

Even though creating an interrupt should not a crash in Blender,
I figured out a way to to avoid the problem. I use a boolean
variable "continueanim" to set to true initially, and then

continueanim = True
while .... and continueanim:
try:
......
simulation/animation code ....
......
except KeyboardInterrupt:
print "Halted simulation..."
continueanim = False


This seems to work well and avoids passing the exception
on to Blender, which causes the crash.

-pf

ascotan
Posts: 0
Joined: Thu May 29, 2003 10:32 pm
Location: Maryland, U.S.

Post by ascotan »

hmm... crashing is bad plz post this with a .blend file + script to the bug tracker to have a look at.

Post Reply