Feat: Renderbucket size is now sent by the server
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user