Feat: Renderbucket size is now sent by the server

This commit is contained in:
Sheepit Renderfarm
2021-12-03 23:38:57 +00:00
parent 20a1ccf07c
commit d137dc924b
12 changed files with 7 additions and 223 deletions

View File

@@ -209,20 +209,13 @@ import java.util.regex.Pattern;
// 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 (isUseGPU() && configuration.getGPUDevice() != null && configuration.getComputeMethod() != ComputeType.CPU) {
// If using a GPU, check the proper tile size
int tileSize = configuration.getGPUDevice().getRenderbucketSize();
core_script = "sheepit_set_compute_device(\"" + configuration.getGPUDevice().getType() + "\", \"GPU\", \"" + configuration.getGPUDevice().getId()
+ "\")\n";
core_script += String.format("bpy.context.scene.render.tile_x = %1$d\nbpy.context.scene.render.tile_y = %1$d\n", tileSize);
log.debug(String.format("Rendering bucket size set to %1$dx%1$d pixels", tileSize));
gui.setComputeMethod("GPU");
}
else {
// Otherwise (CPU), fix the tile size to 32x32px
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", CPU.MIN_RENDERBUCKET_SIZE);
gui.setComputeMethod("CPU");
}