From e5c65709a264fcd07170d6f1287c73d601a3add4 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 27 May 2022 12:09:14 +0200 Subject: Fix T98379: Wrong evaluation when deactivating/activating collections This is a regression caused by a230445caec6. The internal cause of the issue was that the synchronization component was no longer tagged as visible (and hence not evaluated) as it not connected to any directly visible IDs. Changed the logic in a way that if any component of an ID is evaluated the synchronization component will be evaluated as well. The naming of the flag in the component node is a bit confusing, but for the simplicity of the change for the upcoming release left it unchanged. --- source/blender/depsgraph/intern/builder/deg_builder.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/depsgraph/intern/builder/deg_builder.cc') diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 8ee94ab0a34..56117a00b73 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -136,8 +136,22 @@ void deg_graph_build_flush_visibility(Depsgraph *graph) for (IDNode *id_node : graph->id_nodes) { for (ComponentNode *comp_node : id_node->components.values()) { comp_node->affects_directly_visible |= id_node->is_directly_visible; + + /* Enforce "visibility" of the syncronization component. + * + * This component is never connected to other ID nodes, and hence can not be handled in the + * same way as other components needed for evaluation. It is only needed for proper + * evaluation of the ID node it belongs to. + * + * The design is such that the synchronization is supposed to happen whenever any part of the + * ID changed/evaluated. Here we mark the component as "visible" so that genetic recalc flag + * flushing and scheduling will handle the component in a generic manner. */ + if (comp_node->type == NodeType::SYNCHRONIZATION) { + comp_node->affects_directly_visible = true; + } } } + for (OperationNode *op_node : graph->operations) { op_node->custom_flags = 0; op_node->num_links_pending = 0; @@ -151,6 +165,7 @@ void deg_graph_build_flush_visibility(Depsgraph *graph) op_node->custom_flags |= DEG_NODE_VISITED; } } + while (!BLI_stack_is_empty(stack)) { OperationNode *op_node; BLI_stack_pop(stack, &op_node); -- cgit v1.2.3 From 4cab98f8be2712664d6e0f76aa06bfbab9f37204 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Jun 2022 15:11:56 +1000 Subject: Cleanup: spelling in comments, use doxy sections --- .../blender/depsgraph/intern/builder/deg_builder.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'source/blender/depsgraph/intern/builder/deg_builder.cc') diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 56117a00b73..a3cd821e82f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -54,9 +54,9 @@ bool deg_check_base_in_depsgraph(const Depsgraph *graph, Base *base) return id_node->has_base; } -/******************************************************************************* - * Base class for builders. - */ +/* -------------------------------------------------------------------- */ +/** \name Base Class for Builders + * \{ */ DepsgraphBuilder::DepsgraphBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuilderCache *cache) : bmain_(bmain), graph_(graph), cache_(cache) @@ -120,9 +120,11 @@ bool DepsgraphBuilder::check_pchan_has_bbone_segments(Object *object, const char return check_pchan_has_bbone_segments(object, pchan); } -/******************************************************************************* - * Builder finalizer. - */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Builder Finalizer. + * \{ */ namespace { @@ -137,7 +139,7 @@ void deg_graph_build_flush_visibility(Depsgraph *graph) for (ComponentNode *comp_node : id_node->components.values()) { comp_node->affects_directly_visible |= id_node->is_directly_visible; - /* Enforce "visibility" of the syncronization component. + /* Enforce "visibility" of the synchronization component. * * This component is never connected to other ID nodes, and hence can not be handled in the * same way as other components needed for evaluation. It is only needed for proper @@ -213,7 +215,7 @@ void deg_graph_build_flush_visibility(Depsgraph *graph) void deg_graph_build_finalize(Main *bmain, Depsgraph *graph) { - /* Make sure dependencies of visible ID datablocks are visible. */ + /* Make sure dependencies of visible ID data-blocks are visible. */ deg_graph_build_flush_visibility(graph); deg_graph_remove_unused_noops(graph); @@ -248,4 +250,6 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph) } } +/** \} */ + } // namespace blender::deg -- cgit v1.2.3