Merge pull request #152 from intrigus/patch-1

Ignore Ctrl+C in render process. Fixes #81
This commit is contained in:
Laurent Clouet
2018-06-14 23:13:04 +02:00
committed by GitHub

View File

@@ -228,6 +228,13 @@ public class Job {
RenderProcess process = getProcessRender();
Timer timerOfMaxRenderTime = null;
String core_script = "";
// When sending Ctrl+C to the terminal it also get's sent to all subprocesses e.g. also the render process.
// The java program handles Ctrl+C but the renderer quits on Ctrl+C.
// This script causes the renderer to ignore Ctrl+C.
String ignore_signal_script= "import signal\n"
+ "def hndl(signum, frame):\n"
+ " pass\n"
+ "signal.signal(signal.SIGINT, hndl)\n";
if (getUseGPU() && config.getGPUDevice() != null && config.getComputeMethod() != ComputeType.CPU) {
core_script = "sheepit_set_compute_device(\"CUDA\", \"GPU\", \"" + config.getGPUDevice().getCudaName() + "\")\n";
gui.setComputeMethod("GPU");
@@ -236,6 +243,8 @@ public class Job {
core_script = "sheepit_set_compute_device(\"NONE\", \"CPU\", \"CPU\")\n";
gui.setComputeMethod("CPU");
}
core_script += ignore_signal_script;
core_script += String.format("bpy.context.scene.render.tile_x = %1$d\nbpy.context.scene.render.tile_y = %1$d\n", getTileSize());
File script_file = null;
String command1[] = getRenderCommand().split(" ");