From aac0c2cc5f0eedb05d48d0e60715516baa49eeba Mon Sep 17 00:00:00 2001 From: Habib Gahbiche Date: Thu, 26 Sep 2024 01:37:23 +0200 Subject: [PATCH] Fix #127051: Compositing using multiple Levels nodes freezes Blender Multiple levels nodes in a row causes blender to freeze when combined with other constant operations. Also, current results of standard deviation are wrong. The problem was that constant folding optimized constant operations away, which caused a cyclic node graph, and therefore the freeze during node graph evaluation. Preventing such optimizations solves the problem. Pull Request: https://projects.blender.org/blender/blender/pulls/127316 --- .../compositor/operations/COM_CalculateMeanOperation.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.cc b/source/blender/compositor/operations/COM_CalculateMeanOperation.cc index 1c851c31897..fa9dc768e1d 100644 --- a/source/blender/compositor/operations/COM_CalculateMeanOperation.cc +++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.cc @@ -16,7 +16,9 @@ CalculateMeanOperation::CalculateMeanOperation() this->add_output_socket(DataType::Value); is_calculated_ = false; setting_ = 1; - flags_.is_constant_operation = true; + + /* Prevent optimization by constant folder. */ + flags_.is_constant_operation = false; needs_canvas_to_get_constant_ = true; }