Worker class cleanup

This commit is contained in:
Brett Williams
2022-10-11 21:43:05 -07:00
parent f20275b1b4
commit 2c5be5632d
6 changed files with 71 additions and 56 deletions

View File

@@ -6,7 +6,7 @@ SUPPORTED_FORMATS = ['TGA', 'RAWTGA', 'JPEG', 'IRIS', 'IRIZ', 'AVIRAW', 'AVIJPEG
'OPEN_EXR', 'OPEN_EXR_MULTILAYER', 'MPEG', 'CINEON', 'DPX', 'DDS', 'JP2']
class BlenderRenderWorker(RenderWorker):
class BlenderRenderWorker(BaseRenderWorker):
def version(self):
version = None
@@ -22,14 +22,14 @@ class BlenderRenderWorker(RenderWorker):
supported_extensions = ['.blend']
install_paths = ['/Applications/Blender.app/Contents/MacOS/Blender']
def __init__(self, input_path, output_path, args=None):
def __init__(self, input_path, output_path, args=None, render_all_frames=False, engine='BLENDER_EEVEE'):
super(BlenderRenderWorker, self).__init__(input_path=input_path, output_path=output_path, args=args)
self.engine = self.args.get('engine', 'BLENDER_EEVEE')
self.engine = engine # or 'CYCLES'
self.format = 'JPEG'
self.frame = 0
self.render_all_frames = self.args.get('render_all_frames', False)
self.render_all_frames = render_all_frames
# Stats
self.current_frame = -1
@@ -67,7 +67,7 @@ class BlenderRenderWorker(RenderWorker):
sample_string = line.split('|')[-1].strip()
if "sample" in sample_string.lower():
samples = re.sub(r'[^\d/]', '', sample_string)
samples = re.sub(r'[^/d/]', '', sample_string)
self.frame_percent_complete = int(samples.split('/')[0]) / int(samples.split('/')[-1])