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:
authorCampbell Barton <ideasman42@gmail.com>2020-05-06 05:18:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-06 05:18:18 +0300
commitc6aa014d3abb0a2240cb7293d58c86be16b02ab3 (patch)
tree01a9385cc19c6df05fa9ef143c8dbbad18cb0f85 /source/blender/editors/space_view3d/view3d_select.c
parentc036ef136960addd27f00857815adbb190abdc89 (diff)
Fix T76445: Selecting an object no longer cycles past the active
In 2.79, selecting an object would cycle past the first object even if selection cycling wasn't in use. Restore this behavior as it wasn't intentionally removed and it's useful to be able to select an object behind the current active object.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c19
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 0a272db1344..67c61b4ecac 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1663,20 +1663,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();
@@ -1780,7 +1791,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;
}
@@ -1912,7 +1923,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);