From df36e1c5dd3c5843bcdc58a7021c6defc25d56ad Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 15 Jan 2020 16:56:06 +1100 Subject: Fix T71091: Object restrict selection conflicts with pose selection Support pose bone selection when the object has hide_select enabled. This is consistent with how all other modes work. --- source/blender/editors/space_view3d/view3d_select.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_view3d/view3d_select.c') diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 85e9a2d7680..89baf60bd8c 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1785,7 +1785,13 @@ static int mixed_bones_object_selectbuffer_extended(ViewContext *vc, return hits; } -/* returns basact */ +/** + * \param has_bones: When true, skip non-bone hits, also allow bases to be used + * that are visible but not select-able, + * since you may be in pose mode with an an unselect-able object. + * + * \return the active base or NULL. + */ static Base *mouse_select_eval_buffer(ViewContext *vc, const uint *buffer, int hits, @@ -1827,7 +1833,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, base = FIRSTBASE(view_layer); while (base) { - if (BASE_SELECTABLE(v3d, base)) { + if (has_bones ? BASE_VISIBLE(v3d, base) : BASE_SELECTABLE(v3d, base)) { if (base->object->runtime.select_id == selcol) { break; } @@ -1844,7 +1850,8 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, while (base) { /* skip objects with select restriction, to prevent prematurely ending this loop * with an un-selectable choice */ - if ((base->flag & BASE_SELECTABLE) == 0) { + if (has_bones ? (base->flag & BASE_VISIBLE_VIEWLAYER) == 0 : + (base->flag & BASE_SELECTABLE) == 0) { base = base->next; if (base == NULL) { base = FIRSTBASE(view_layer); @@ -1854,7 +1861,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, } } - if (BASE_SELECTABLE(v3d, base)) { + if (has_bones ? BASE_VISIBLE(v3d, base) : BASE_SELECTABLE(v3d, base)) { for (a = 0; a < hits; a++) { if (has_bones) { /* skip non-bone objects */ -- cgit v1.2.3