- Blender in background render mode (blender -b) now reacts to CTRL+C
again. You'll have to do it twice... first CTRL+C will send an internal break (exit render loops) - I prefer this in foreground mode too, but Python uses it as well, to escape from loops. We have to fix this once.
This commit is contained in:
@@ -86,6 +86,7 @@
|
|||||||
#include "SYS_System.h"
|
#include "SYS_System.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#ifndef __OpenBSD__
|
#ifndef __OpenBSD__
|
||||||
#include <floatingpoint.h>
|
#include <floatingpoint.h>
|
||||||
@@ -126,6 +127,25 @@ static void fpe_handler(int sig)
|
|||||||
// printf("SIGFPE trapped\n");
|
// printf("SIGFPE trapped\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* handling ctrl-c event in console */
|
||||||
|
static void blender_esc(int sig)
|
||||||
|
{
|
||||||
|
static int count = 0;
|
||||||
|
|
||||||
|
G.afbreek = 1; /* forces render loop to read queue, not sure if its needed */
|
||||||
|
|
||||||
|
if (sig == 2) {
|
||||||
|
if (count) {
|
||||||
|
printf("\nBlender killed\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
printf("\nSent an internal break event. Press ^C again to kill Blender\n");
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void print_help(void)
|
static void print_help(void)
|
||||||
{
|
{
|
||||||
printf ("Blender V %d.%02d\n", G.version/100, G.version%100);
|
printf ("Blender V %d.%02d\n", G.version/100, G.version%100);
|
||||||
@@ -202,6 +222,7 @@ int main(int argc, char **argv)
|
|||||||
argv[1]= firstfilebuf;
|
argv[1]= firstfilebuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
@@ -295,6 +316,10 @@ int main(int argc, char **argv)
|
|||||||
setuid(getuid()); /* end superuser */
|
setuid(getuid()); /* end superuser */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* for all platforms, even windos has it! */
|
||||||
|
if(G.background) signal(SIGINT, blender_esc); /* ctrl c out bg render */
|
||||||
|
|
||||||
|
|
||||||
RE_init_render_data(); /* must be called here because R.winpos from default file */
|
RE_init_render_data(); /* must be called here because R.winpos from default file */
|
||||||
|
|
||||||
if(G.background==0) {
|
if(G.background==0) {
|
||||||
|
Reference in New Issue
Block a user