Fix #20 - Relaunch renderer when renderer crashes (#28)

* Render worker makes multiple attempts if file_path increases on each run

* Change blender_worker.py to not overwrite existing files

* Chmod +x to client
This commit is contained in:
2023-07-02 23:50:15 -05:00
committed by GitHub
parent a475aa999a
commit 4563dcb255
4 changed files with 52 additions and 30 deletions

View File

@@ -37,8 +37,13 @@ class BlenderRenderWorker(BaseRenderWorker):
cmd.append('-b')
cmd.append(self.input_path)
# Python expressions
cmd.append('--python-expr')
python_exp = 'import bpy; bpy.context.scene.render.use_overwrite = False;'
if self.camera:
cmd.extend(['--python-expr', f"import bpy;bpy.context.scene.camera = bpy.data.objects['{self.camera}'];"])
python_exp = python_exp + f"bpy.context.scene.camera = bpy.data.objects['{self.camera}'];"
# insert any other python exp checks here
cmd.append(python_exp)
path_without_ext = os.path.splitext(self.output_path)[0] + "_"
cmd.extend(['-E', self.blender_engine, '-o', path_without_ext, '-F', self.export_format])