From e276558a50f06c6ec5d6b36b138ad5777dd05c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 2 Apr 2020 16:54:17 +0200 Subject: Fix T74983: Material preview icons don't refresh The root cause of the issue reported in T74983 is that an `IDNode` would not be marked as user-modified. This marking happened while looping over outgoing relations of one of its operation nodes. Since rBff60dd8b18ed unused relations are removed, and as a result the `IDNode` would not be marked. The solution was to move the responsible code outside the loop; this is probably a good idea anyway, as the code did not actually use the looped-over relations at all, and was thus repeated unnecessarily. --- source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index dd72bc22a70..990002cf2e8 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -172,16 +172,17 @@ BLI_INLINE void flush_handle_component_node(IDNode *id_node, */ BLI_INLINE OperationNode *flush_schedule_children(OperationNode *op_node, FlushQueue *queue) { + if (op_node->flag & DEPSOP_FLAG_USER_MODIFIED) { + IDNode *id_node = op_node->owner->owner; + id_node->is_user_modified = true; + } + OperationNode *result = nullptr; for (Relation *rel : op_node->outlinks) { /* Flush is forbidden, completely. */ if (rel->flag & RELATION_FLAG_NO_FLUSH) { continue; } - if (op_node->flag & DEPSOP_FLAG_USER_MODIFIED) { - IDNode *id_node = op_node->owner->owner; - id_node->is_user_modified = true; - } /* Relation only allows flushes on user changes, but the node was not * affected by user. */ if ((rel->flag & RELATION_FLAG_FLUSH_USER_EDIT_ONLY) && -- cgit v1.2.3