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:
authorBrecht Van Lommel <brecht@blender.org>2022-09-05 18:14:40 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-09-08 16:23:21 +0300
commit173d8edb0bb6e017235ef85a10963f39725c29ef (patch)
treefc40e57981ed83c0a1bb3532da322843a5571238 /source/blender/editors/object
parentb5fc8f611e3948a19c26d425496d76079506f480 (diff)
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
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.cc2
-rw-r--r--source/blender/editors/object/object_bake_api.c11
-rw-r--r--source/blender/editors/object/object_edit.c2
-rw-r--r--source/blender/editors/object/object_select.c2
4 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc
index 1068da6816f..ddd54aa7953 100644
--- a/source/blender/editors/object/object_add.cc
+++ b/source/blender/editors/object/object_add.cc
@@ -3573,7 +3573,7 @@ static Base *object_add_duplicate_internal(Main *bmain,
DEG_id_tag_update(&obn->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
base = BKE_view_layer_base_find(view_layer, ob);
- if ((base != nullptr) && (base->flag & BASE_VISIBLE_DEPSGRAPH)) {
+ if ((base != nullptr) && (base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT)) {
BKE_collection_object_add_from(bmain, scene, ob, obn);
}
else {
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 8db699cceb8..f7b66241081 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -1409,7 +1409,8 @@ static int bake(const BakeAPIRender *bkr,
else {
ob_cage_eval = DEG_get_evaluated_object(depsgraph, ob_cage);
ob_cage_eval->visibility_flag |= OB_HIDE_RENDER;
- ob_cage_eval->base_flag &= ~(BASE_VISIBLE_DEPSGRAPH | BASE_ENABLED_RENDER);
+ ob_cage_eval->base_flag &= ~(BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT |
+ BASE_ENABLED_RENDER);
}
}
}
@@ -1509,7 +1510,8 @@ static int bake(const BakeAPIRender *bkr,
highpoly[i].ob = ob_iter;
highpoly[i].ob_eval = DEG_get_evaluated_object(depsgraph, ob_iter);
highpoly[i].ob_eval->visibility_flag &= ~OB_HIDE_RENDER;
- highpoly[i].ob_eval->base_flag |= (BASE_VISIBLE_DEPSGRAPH | BASE_ENABLED_RENDER);
+ highpoly[i].ob_eval->base_flag |= (BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT |
+ BASE_ENABLED_RENDER);
highpoly[i].me = BKE_mesh_new_from_object(NULL, highpoly[i].ob_eval, false, false);
/* Low-poly to high-poly transformation matrix. */
@@ -1525,10 +1527,11 @@ static int bake(const BakeAPIRender *bkr,
if (ob_cage != NULL) {
ob_cage_eval->visibility_flag |= OB_HIDE_RENDER;
- ob_cage_eval->base_flag &= ~(BASE_VISIBLE_DEPSGRAPH | BASE_ENABLED_RENDER);
+ ob_cage_eval->base_flag &= ~(BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT |
+ BASE_ENABLED_RENDER);
}
ob_low_eval->visibility_flag |= OB_HIDE_RENDER;
- ob_low_eval->base_flag &= ~(BASE_VISIBLE_DEPSGRAPH | BASE_ENABLED_RENDER);
+ ob_low_eval->base_flag &= ~(BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT | BASE_ENABLED_RENDER);
/* populate the pixel arrays with the corresponding face data for each high poly object */
pixel_array_high = MEM_mallocN(sizeof(BakePixel) * targets.pixels_num,
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 1bfb0c5f260..cc16b58fa72 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -287,7 +287,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op)
/* Hide selected or unselected objects. */
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
- if (!(base->flag & BASE_VISIBLE_VIEWLAYER)) {
+ if (!(base->flag & BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT)) {
continue;
}
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 82c39d38d74..2ce00490273 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -203,7 +203,7 @@ bool ED_object_base_deselect_all(ViewLayer *view_layer, View3D *v3d, int action)
static int get_base_select_priority(Base *base)
{
- if (base->flag & BASE_VISIBLE_DEPSGRAPH) {
+ if (base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT) {
if (base->flag & BASE_SELECTABLE) {
return 3;
}