From d78c42b02fec664da11fd4bdc45a0c013bd8cea4 Mon Sep 17 00:00:00 2001 From: Swann Date: Sat, 11 Dec 2021 17:57:09 +0100 Subject: [PATCH] fix: filepath --- multi_user/operators.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/multi_user/operators.py b/multi_user/operators.py index 0be114f..f0c0cec 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -59,7 +59,7 @@ deleyables = [] stop_modal_executor = False CLEARED_DATABLOCKS = ['actions', 'armatures', 'cache_files', 'cameras', - 'collections', 'curves', 'filepath', 'fonts', + 'collections', 'curves', 'fonts', 'grease_pencils', 'images', 'lattices', 'libraries', 'lightprobes', 'lights', 'linestyles', 'masks', 'materials', 'meshes', 'metaballs', 'movieclips', @@ -1033,6 +1033,26 @@ class SessionStopAutoSaveOperator(bpy.types.Operator): return {'FINISHED'} +class SessionRenderReplay(bpy.types.Operator): + bl_idname = "session.render_replay" + bl_label = "Render Replay" + bl_description = "Render Replay" + + @classmethod + def poll(cls, context): + return context.window_manager.session.replay_files + + def execute(self, context): + base_path = str(context.scene.render.filepath) + for frame in range(0,context.scene.frame_end): + logging.info(f"Rendering frame {frame} to {base_path}_{frame}.png") + context.scene.frame_current = frame + filename = Path(bpy.context.window_manager.session.replay_files[context.scene.active_replay_file].name) + context.scene.render.filepath = f"{base_path}{frame}_{filename.stem}" + bpy.ops.render.render(write_still=True) + + context.scene.render.filepath = base_path + return {'FINISHED'} class SessionLoadSaveOperator(bpy.types.Operator, ImportHelper): bl_idname = "session.load" @@ -1214,6 +1234,7 @@ class SessionLoadSaveOperator(bpy.types.Operator, ImportHelper): runtime_settings.replay_camera: bpy.context.scene.camera = runtime_settings.replay_camera + bpy.context.scene.eevee.use_bloom = False return {'FINISHED'} @@ -1243,6 +1264,7 @@ classes = ( SessionLoadSaveOperator, SessionStopAutoSaveOperator, SessionPurgeOperator, + SessionRenderReplay ) def update_external_dependencies():