diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-08-04 16:04:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-08-10 12:02:38 +0300 |
commit | f12f7800c2965c721a4eb4baeb6b1ab129bfa375 (patch) | |
tree | 53d35435e164f6bd0c1b35fa47a0294dfa299375 /source/blender/depsgraph/intern/node/deg_node_operation.cc | |
parent | cfbe11563a5dfd39e5b765b986892382f6f4db99 (diff) |
Depsgraph: Optimize evaluation of dependencies of disabled modifiers
Solves long-standing issue when dependencies of disabled modifiers are
evaluated.
Simple test case: no drivers or animation. Manually enabling modifier
is expected to bring FPS up, enabling modifier will bring FPS (sine
evaluation can not be avoided)
F13336690
More complex test case: modifier visibility is driven by an animated
property. In am ideal world FPS during property being zero is fast
and when property is 1 the FPS is low.
F13336691.
Differential Revision: https://developer.blender.org/D15625
Diffstat (limited to 'source/blender/depsgraph/intern/node/deg_node_operation.cc')
-rw-r--r-- | source/blender/depsgraph/intern/node/deg_node_operation.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc index 4c8c8089ac1..65adfded6b3 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc @@ -227,6 +227,16 @@ void OperationNode::tag_update(Depsgraph *graph, eUpdateSource source) * the evaluated clues that evaluation needs to happen again. */ graph->add_entry_tag(this); + /* Enforce dynamic visibility codepath update. + * This ensures visibility flags are consistently propagated throughout the dependency graph when + * there is no animated visibility in the graph. + * + * For example this ensures that graph is updated properly when manually toggling non-animated + * modifier visibility. */ + if (opcode == OperationCode::VISIBILITY) { + graph->need_update_nodes_visibility = true; + } + /* Tag for update, but also note that this was the source of an update. */ flag |= (DEPSOP_FLAG_NEEDS_UPDATE | DEPSOP_FLAG_DIRECTLY_MODIFIED); switch (source) { |