[Bf-blender-cvs] [e3b49bb8500] master: Fix T81200: Crash on certain armature select operators when OpenGL Depth Picking is disabled

Philipp Oeser noreply at git.blender.org
Fri Oct 2 17:06:27 CEST 2020


Commit: e3b49bb850018ae73088b8d4e7c195206f8b2f31
Author: Philipp Oeser
Date:   Thu Oct 1 18:11:51 2020 +0200
Branches: master
https://developer.blender.org/rBe3b49bb850018ae73088b8d4e7c195206f8b2f31

Fix T81200: Crash on certain armature select operators when OpenGL Depth
Picking is disabled

Affected were (at least)
- Select Linked pick
- Select Shortest Path

Was originally caused by rB8b347fc2cdc6 [which got improved in
rBfc8a7a44b200 - but only partially].

After removal of BONESEL_NOSEL we have to filter out -1 from the hits for
any bone picking it seems (since armature drawing uses this).
In rBfc8a7a44b200, this was done for 'ED_armature_edit_select_pick' (or
'get_nearest_editbonepoint' precisely), now do this for
'ed_armature_pick_bone_impl' as well.

Reviewers: campbellbarton

Maniphest Tasks: T81200

Differential Revision: https://developer.blender.org/D9080

===================================================================

M	source/blender/editors/armature/armature_select.c

===================================================================

diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 4c5efb304c9..09d54410e55 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -335,8 +335,16 @@ static void *ed_armature_pick_bone_impl(
 
   BLI_rcti_init_pt_radius(&rect, xy, 0);
 
-  hits = view3d_opengl_select(
-      &vc, buffer, MAXPICKBUF, &rect, VIEW3D_SELECT_PICK_NEAREST, VIEW3D_SELECT_FILTER_NOP);
+  /* Don't use hits with this ID, (armature drawing uses this). */
+  const int select_id_ignore = -1;
+
+  hits = view3d_opengl_select_with_id_filter(&vc,
+                                             buffer,
+                                             MAXPICKBUF,
+                                             &rect,
+                                             VIEW3D_SELECT_PICK_NEAREST,
+                                             VIEW3D_SELECT_FILTER_NOP,
+                                             select_id_ignore);
 
   *r_base = NULL;



More information about the Bf-blender-cvs mailing list