Fix #135647: Compositor viewer doesn't update on render

Since the introduction of e53ac805af, viewer and previews were not
computed when rendering, because we assumed those would only be useful
during interactive compositing. But we received multiple reports that
this is broken. So users generally expect rendering to compute viewers
and previews.

This patch makes a distinction between background rendering and F12
renders, where the latter computes viewer and previews. This should not
have significant effect on the render time, because typically viewer
results are already computed as part of computing composite results.

Pull Request: https://projects.blender.org/blender/blender/pulls/135723
This commit is contained in:
Omar Emara
2025-03-10 12:31:00 +01:00
committed by Omar Emara
parent 0f13ef0bee
commit c14706e5c9
+9 -2
View File
@@ -1373,6 +1373,14 @@ static void do_render_compositor(Render *re)
/* If we have consistent depsgraph now would be a time to update them. */
}
blender::compositor::OutputTypes needed_outputs =
blender::compositor::OutputTypes::Composite |
blender::compositor::OutputTypes::FileOutput;
if (!G.background) {
needed_outputs |= blender::compositor::OutputTypes::Viewer |
blender::compositor::OutputTypes::Previews;
}
blender::compositor::RenderContext compositor_render_context;
LISTBASE_FOREACH (RenderView *, rv, &re->result->views) {
COM_execute(re,
@@ -1382,8 +1390,7 @@ static void do_render_compositor(Render *re)
rv->name,
&compositor_render_context,
nullptr,
blender::compositor::OutputTypes::Composite |
blender::compositor::OutputTypes::FileOutput);
needed_outputs);
}
compositor_render_context.save_file_outputs(re->pipeline_scene_eval);