diff --git a/source/blender/compositor/realtime_compositor/COM_context.hh b/source/blender/compositor/realtime_compositor/COM_context.hh index 612d8b8c89f..eb487d9e008 100644 --- a/source/blender/compositor/realtime_compositor/COM_context.hh +++ b/source/blender/compositor/realtime_compositor/COM_context.hh @@ -54,6 +54,9 @@ class Context { /* True if the compositor should write file outputs, false otherwise. */ virtual bool use_file_output() const = 0; + /* True if the compositor should compute node previews, false otherwise. */ + virtual bool should_compute_node_previews() const = 0; + /* True if the compositor should write the composite output, otherwise, the compositor is assumed * to not support the composite output and just displays its viewer output. In that case, the * composite output will be used as a fallback viewer if no other viewer exists */ diff --git a/source/blender/compositor/realtime_compositor/intern/node_operation.cc b/source/blender/compositor/realtime_compositor/intern/node_operation.cc index a06efd173c8..7f1e6aefafc 100644 --- a/source/blender/compositor/realtime_compositor/intern/node_operation.cc +++ b/source/blender/compositor/realtime_compositor/intern/node_operation.cc @@ -60,7 +60,7 @@ void NodeOperation::evaluate() void NodeOperation::compute_preview() { - if (is_node_preview_needed(node())) { + if (context().should_compute_node_previews() && is_node_preview_needed(node())) { compute_preview_from_result(context(), node(), *get_preview_result()); } } diff --git a/source/blender/draw/engines/compositor/compositor_engine.cc b/source/blender/draw/engines/compositor/compositor_engine.cc index f8f0ae3dadb..e4c1c29d0cb 100644 --- a/source/blender/draw/engines/compositor/compositor_engine.cc +++ b/source/blender/draw/engines/compositor/compositor_engine.cc @@ -74,6 +74,11 @@ class Context : public realtime_compositor::Context { return false; } + bool should_compute_node_previews() const override + { + return false; + } + /* The viewport compositor doesn't really support the composite output, it only displays the * viewer output in the viewport. Settings this to false will make the compositor use the * composite output as fallback viewer if no other viewer exists. */ diff --git a/source/blender/render/intern/compositor.cc b/source/blender/render/intern/compositor.cc index e1ce71c892e..a7f46585711 100644 --- a/source/blender/render/intern/compositor.cc +++ b/source/blender/render/intern/compositor.cc @@ -198,6 +198,11 @@ class Context : public realtime_compositor::Context { return this->render_context() != nullptr; } + bool should_compute_node_previews() const override + { + return this->render_context() == nullptr; + } + bool use_composite_output() const override { return true;