From 173d8edb0bb6e017235ef85a10963f39725c29ef Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 5 Sep 2022 17:14:40 +0200 Subject: Cleanup: make meaning of base visibility flags more clear Rename, add comments, and use flag in the depsgraph to ensure the logic matches. Differential Revision: https://developer.blender.org/D15883 --- source/blender/depsgraph/intern/depsgraph_query_iter.cc | 2 +- source/blender/depsgraph/intern/eval/deg_eval_visibility.cc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/depsgraph') diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc index 2d2ee5dc4b4..bcae5de1e1e 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc @@ -182,7 +182,7 @@ bool deg_iterator_duplis_step(DEGObjectIterData *data) } /* Duplicated elements shouldn't care whether their original collection is visible or not. */ - temp_dupli_object->base_flag |= BASE_VISIBLE_DEPSGRAPH; + temp_dupli_object->base_flag |= BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT; int ob_visibility = BKE_object_visibility(temp_dupli_object, data->eval_mode); if ((ob_visibility & (OB_VISIBLE_SELF | OB_VISIBLE_PARTICLES)) == 0) { diff --git a/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc b/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc index e35e992fc8b..515c9a197d7 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_visibility.cc @@ -36,8 +36,7 @@ void deg_evaluate_object_node_visibility(::Depsgraph *depsgraph, IDNode *id_node bool is_enabled; if (graph->mode == DAG_EVAL_VIEWPORT) { - is_enabled = (object->base_flag & BASE_ENABLED_VIEWPORT) && - ((object->base_flag & BASE_HIDDEN) == 0); + is_enabled = (object->base_flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT); } else { is_enabled = (object->base_flag & BASE_ENABLED_RENDER); -- cgit v1.2.3