From f80b4a4f551f62496ab9abfe9fca31409c294901 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 27 Mar 2024 11:00:55 +0100 Subject: [PATCH] Fix #119936: Crash selecting in mask editor Regression since 7a2d04a5c43. Mask evaluation is part of parameters component, and there is no explicit tags other than copy-on-eval for masks in a lot of cases. Restore the previous graph topology for the link from copy-on-eval to the parameters components of mask ID. Potential candidate for 4.1.1. Pull Request: https://projects.blender.org/blender/blender/pulls/119956 --- .../depsgraph/intern/builder/deg_builder_relations.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 691f60f407e..16dac184eaa 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -3447,6 +3447,15 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDNode *id_node) if (ELEM(comp_node->type, NodeType::LAYER_COLLECTIONS)) { rel_flag &= ~RELATION_FLAG_NO_FLUSH; } + /* Mask evaluation operation is part of parameters, and it needs to be re-evaluated when the + * mask is tagged for copy-on-eval. + * + * TODO(@sergey): This needs to be moved out of here. + * In order to do so, moving mask evaluation out of parameters would be helpful and + * semantically correct. */ + if (comp_node->type == NodeType::PARAMETERS && id_type == ID_MSK) { + rel_flag &= ~RELATION_FLAG_NO_FLUSH; + } /* Compatibility with the legacy tagging: groups are only tagged for Copy-on-Write when their * hierarchy changes, and it needs to be flushed downstream. */ if (id_type == ID_GR && comp_node->type == NodeType::HIERARCHY) {