diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-03 16:20:43 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-03 17:19:32 +0300 |
commit | ba1cae5a04d429e2f4e58d5fd1e740c70462620a (patch) | |
tree | a3299b49718e2cd74f412807fb97156a77d98efa /source/blender/editors | |
parent | a2d24345bfead8e4279a818a67d73d42d2565b96 (diff) |
Fix some inconsistencies in object visibility/selectability tests.
Diffstat (limited to 'source/blender/editors')
6 files changed, 12 insertions, 48 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 15d9b3c5ccb..d5683ae1267 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -121,16 +121,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } else if (CTX_data_equals(member, "selectable_objects")) { for (Base *base = view_layer->object_bases.first; base; base = base->next) { - if (v3d && v3d->localvd && ((base->local_view_bits & v3d->local_view_uuid) == 0)) { - continue; - } - if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { - continue; - } - if (v3d && ((v3d->object_type_exclude_select & (1 << base->object->type)) != 0)) { - continue; - } - if (((base->flag & BASE_VISIBLE) != 0) && ((base->flag & BASE_SELECTABLE) != 0)) { + if (BASE_SELECTABLE_BGMODE(v3d, base)) { CTX_data_id_list_add(result, &base->object->id); } } @@ -180,16 +171,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } else if (CTX_data_equals(member, "selectable_bases")) { for (Base *base = view_layer->object_bases.first; base; base = base->next) { - if (v3d && v3d->localvd && ((base->local_view_bits & v3d->local_view_uuid) == 0)) { - continue; - } - if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { - continue; - } - if (v3d && ((v3d->object_type_exclude_select & (1 << base->object->type)) != 0)) { - continue; - } - if ((base->flag & BASE_VISIBLE) && (base->flag & BASE_SELECTABLE) != 0) { + if (BASE_SELECTABLE_BGMODE(v3d, base)) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); } } @@ -198,13 +180,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } else if (CTX_data_equals(member, "selected_bases")) { for (Base *base = view_layer->object_bases.first; base; base = base->next) { - if (v3d && v3d->localvd && ((base->local_view_bits & v3d->local_view_uuid) == 0)) { - continue; - } - if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { - continue; - } - if ((base->flag & BASE_SELECTED) != 0) { + if (BASE_VISIBLE_BGMODE(v3d, base) && (base->flag & BASE_SELECTED) != 0) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); } } @@ -213,13 +189,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } else if (CTX_data_equals(member, "selected_editable_bases")) { for (Base *base = view_layer->object_bases.first; base; base = base->next) { - if (v3d && v3d->localvd && ((base->local_view_bits & v3d->local_view_uuid) == 0)) { - continue; - } - if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { - continue; - } - if ((base->flag & BASE_SELECTED) != 0) { + if (BASE_VISIBLE_BGMODE(v3d, base) && (base->flag & BASE_SELECTED) != 0) { if (0 == BKE_object_is_libdata(base->object)) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); } @@ -231,13 +201,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult else if (CTX_data_equals(member, "editable_bases")) { /* Visible + Editable, but not necessarily selected */ for (Base *base = view_layer->object_bases.first; base; base = base->next) { - if (v3d && v3d->localvd && ((base->local_view_bits & v3d->local_view_uuid) == 0)) { - continue; - } - if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { - continue; - } - if ((base->flag & BASE_VISIBLE) != 0) { + if (BASE_VISIBLE_BGMODE(v3d, base)) { if (0 == BKE_object_is_libdata(base->object)) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_armature.c b/source/blender/editors/space_view3d/view3d_gizmo_armature.c index b29ce64eba5..3d7e8065a9f 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_armature.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_armature.c @@ -138,7 +138,7 @@ static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmGizmoGroupType ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); - if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + if (base && BASE_SELECTABLE(v3d, base)) { Object *ob = BKE_object_pose_armature_get(base->object); if (ob) { const bArmature *arm = ob->data; diff --git a/source/blender/editors/space_view3d/view3d_gizmo_camera.c b/source/blender/editors/space_view3d/view3d_gizmo_camera.c index 472c9571223..bf37f9c3b49 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_camera.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_camera.c @@ -72,7 +72,7 @@ static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *UNUSED( ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); - if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + if (base && BASE_SELECTABLE(v3d, base)) { Object *ob = base->object; if (ob->type == OB_CAMERA) { Camera *camera = ob->data; diff --git a/source/blender/editors/space_view3d/view3d_gizmo_empty.c b/source/blender/editors/space_view3d/view3d_gizmo_empty.c index 24236ac2e6c..b0eb9993576 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_empty.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_empty.c @@ -120,7 +120,7 @@ static bool WIDGETGROUP_empty_image_poll(const bContext *C, wmGizmoGroupType *UN ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); - if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + if (base && BASE_SELECTABLE(v3d, base)) { Object *ob = base->object; if (ob->type == OB_EMPTY) { if (ob->empty_drawtype == OB_EMPTY_IMAGE) { diff --git a/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c b/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c index 656836488ba..b49a38085a1 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_forcefield.c @@ -64,7 +64,7 @@ static bool WIDGETGROUP_forcefield_poll(const bContext *C, wmGizmoGroupType *UNU ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); - if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + if (base && BASE_SELECTABLE(v3d, base)) { Object *ob = base->object; if (ob->pd && ob->pd->forcefield) { return true; diff --git a/source/blender/editors/space_view3d/view3d_gizmo_lamp.c b/source/blender/editors/space_view3d/view3d_gizmo_lamp.c index 0edc30597c4..a723dae058a 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_lamp.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_lamp.c @@ -65,7 +65,7 @@ static bool WIDGETGROUP_lamp_spot_poll(const bContext *C, wmGizmoGroupType *UNUS ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); - if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + if (base && BASE_SELECTABLE(v3d, base)) { Object *ob = base->object; if (ob->type == OB_LAMP) { Lamp *la = ob->data; @@ -174,7 +174,7 @@ static bool WIDGETGROUP_lamp_area_poll(const bContext *C, wmGizmoGroupType *UNUS ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); - if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + if (base && BASE_SELECTABLE(v3d, base)) { Object *ob = base->object; if (ob->type == OB_LAMP) { Lamp *la = ob->data; @@ -258,7 +258,7 @@ static bool WIDGETGROUP_lamp_target_poll(const bContext *C, wmGizmoGroupType *UN ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = BASACT(view_layer); - if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + if (base && BASE_SELECTABLE(v3d, base)) { Object *ob = base->object; if (ob->type == OB_LAMP) { Lamp *la = ob->data; |