From f88fa05fb5abaa580e4d3f4b979bd9cd5d107b18 Mon Sep 17 00:00:00 2001 From: Laurent Clouet Date: Sat, 11 Feb 2017 16:54:40 +0100 Subject: [PATCH] Blender 2.78b doesn't handle gpu the same way, i might changed again so deport the preferences calls to the server side --- src/com/sheepit/client/Job.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/sheepit/client/Job.java b/src/com/sheepit/client/Job.java index 39b01af..225a64b 100644 --- a/src/com/sheepit/client/Job.java +++ b/src/com/sheepit/client/Job.java @@ -215,12 +215,12 @@ public class Job { public Error.Type render() { gui.status("Rendering"); RenderProcess process = getProcessRender(); - String core_script = "import bpy\n" + "bpy.context.user_preferences.system.compute_device_type = \"%s\"\n" + "bpy.context.scene.cycles.device = \"%s\"\n" + "bpy.context.user_preferences.system.compute_device = \"%s\"\n"; + String core_script = ""; if (getUseGPU() && config.getGPUDevice() != null && config.getComputeMethod() != ComputeType.CPU) { - core_script = String.format(core_script, "CUDA", "GPU", config.getGPUDevice().getCudaName()); + core_script = "sheepit_set_compute_device(\"CUDA\", \"GPU\", \"" + config.getGPUDevice().getCudaName() + "\")\n"; } else { - core_script = String.format(core_script, "NONE", "CPU", "CPU"); + core_script = "sheepit_set_compute_device(\"NONE\", \"CPU\", \"CPU\")\n"; } 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;