diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-06 05:26:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-06 05:26:01 +0300 |
commit | 9959322d6e5451ebc5b39a45520dca4159728944 (patch) | |
tree | c6c3f1cfe3ca5e59c1db2426eb14ee5ff01497c1 /source/blender/editors/space_view3d | |
parent | 4dc124f6422e6cc08528f42153cdcc7d3480e63c (diff) | |
parent | c6aa014d3abb0a2240cb7293d58c86be16b02ab3 (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 69425bea364..2ce2edb98fe 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1685,20 +1685,31 @@ static int selectbuffer_ret_hits_5(uint *buffer, /** * Populate a select buffer with objects and bones, if there are any. * Checks three selection levels and compare. + * + * \param do_nearest_xray_if_supported: When set, read in hits that don't stop + * at the nearest surface. The hit's must still be ordered by depth. + * Needed so we can step to the next, non-active object when it's already selected, see: T76445. */ static int mixed_bones_object_selectbuffer(ViewContext *vc, uint *buffer, const int mval[2], eV3DSelectObjectFilter select_filter, - bool do_nearest) + bool do_nearest, + bool do_nearest_xray_if_supported) { rcti rect; int hits15, hits9 = 0, hits5 = 0; bool has_bones15 = false, has_bones9 = false, has_bones5 = false; - const int select_mode = (do_nearest ? VIEW3D_SELECT_PICK_NEAREST : VIEW3D_SELECT_PICK_ALL); + int select_mode = (do_nearest ? VIEW3D_SELECT_PICK_NEAREST : VIEW3D_SELECT_PICK_ALL); int hits = 0; + if (do_nearest_xray_if_supported) { + if ((U.gpu_flag & USER_GPU_FLAG_NO_DEPT_PICK) == 0) { + select_mode = VIEW3D_SELECT_PICK_ALL; + } + } + /* we _must_ end cache before return, use 'goto finally' */ view3d_opengl_select_cache_begin(); @@ -1802,7 +1813,7 @@ static int mixed_bones_object_selectbuffer_extended(ViewContext *vc, do_nearest = do_nearest && !enumerate; - int hits = mixed_bones_object_selectbuffer(vc, buffer, mval, select_filter, do_nearest); + int hits = mixed_bones_object_selectbuffer(vc, buffer, mval, select_filter, do_nearest, true); return hits; } @@ -1934,7 +1945,7 @@ Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2]) const bool do_nearest = !XRAY_ACTIVE(vc.v3d); const int hits = mixed_bones_object_selectbuffer( - &vc, buffer, mval, VIEW3D_SELECT_FILTER_NOP, do_nearest); + &vc, buffer, mval, VIEW3D_SELECT_FILTER_NOP, do_nearest, false); if (hits > 0) { const bool has_bones = selectbuffer_has_bones(buffer, hits); |