Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-11-08 16:02:29 +0300
committerSergey Sharybin <sergey@blender.org>2022-11-09 16:20:26 +0300
commitc26d49e854b345094828ecf908e050a4d9c637cf (patch)
tree73f0748d2a85f4adfedd0a6346185820e510cf4d /source/blender/depsgraph/intern/eval/deg_eval_visibility.cc
parentfb52a09840efa4dbaa21176f6ecec4f4fef63f64 (diff)
Fix T101906: Modifier apply not working if target object is in excluded collection
The issue was introduced by the optimization of hidden objects and modifiers in the f12f7800c296. The solution here detects that either an object is hidden or the modifier is disabled and does special tricks to ensure the dependencies are evaluated. This is done by constructing a separate minimal dependency graph needed for the object on which the modifier is being applied on. This minimal dependency graph will not perform visibility optimization, making it so modifier dependencies are ensured to be evaluated. The downside of such approach is that some dependencies which are not needed for the modifier are still evaluated. There is no currently an easy way to avoid this. At least not without introducing possible race conditions with other dependency graphs. If the performance of applying modifiers in such cases becomes a problem the possible solution would be to create a temporary object with a single modifier so that only minimal set of dependencies is pulled in the minimal dependency graph. Differential Revision: https://developer.blender.org/D16421
Diffstat (limited to 'source/blender/depsgraph/intern/eval/deg_eval_visibility.cc')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_visibility.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc b/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc
index a056ba1dfa7..0ee4052eff3 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc
@@ -37,7 +37,8 @@ void deg_evaluate_object_node_visibility(::Depsgraph *depsgraph, IDNode *id_node
const int required_flags = (graph->mode == DAG_EVAL_VIEWPORT) ? BASE_ENABLED_VIEWPORT :
BASE_ENABLED_RENDER;
- const bool is_enabled = object->base_flag & required_flags;
+ const bool is_enabled = !graph->use_visibility_optimization ||
+ object->base_flag & required_flags;
if (id_node->is_enabled_on_eval != is_enabled) {
id_node->is_enabled_on_eval = is_enabled;
@@ -73,7 +74,8 @@ void deg_evaluate_object_modifiers_mode_node_visibility(::Depsgraph *depsgraph,
"Modifier node in depsgraph is not found. Likely due to missing "
"DEG_relations_tag_update().");
- const bool modifier_enabled = modifier->mode & modifier_mode;
+ const bool modifier_enabled = !graph->use_visibility_optimization ||
+ (modifier->mode & modifier_mode);
const int mute_flag = modifier_enabled ? 0 : DEPSOP_FLAG_MUTE;
if ((modifier_node->flag & DEPSOP_FLAG_MUTE) != mute_flag) {
modifier_node->flag &= ~DEPSOP_FLAG_MUTE;