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-06-10 10:50:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-10 11:04:01 +0300
commitfc8a7a44b200e37066a8753c514564c674eace30 (patch)
tree5693da7412b5ca8f9a5552b9c59754cf4c11c9b1 /source/blender/editors/armature/armature_select.c
parentedb4e553f506c858e7df5e45ad6235cd59a181eb (diff)
Fix T77560: Bone selection crashes
The was caused by 8b347fc2cdc67 as the old BONESEL_NOSEL flag handled the -1 case (used for none). Instead of checking for -1, remove these elements from the array as selection code makes decisions based on the number of hits detected.
Diffstat (limited to 'source/blender/editors/armature/armature_select.c')
-rw-r--r--source/blender/editors/armature/armature_select.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 8e03dbc7dc3..eb7c1bc74ea 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -678,6 +678,8 @@ static EditBone *get_nearest_editbonepoint(
/* matching logic from 'mixed_bones_object_selectbuffer' */
int hits = 0;
+ /* Don't use hits with this ID, (armature drawing uses this). */
+ const int select_id_ignore = -1;
/* we _must_ end cache before return, use 'goto cache_end' */
view3d_opengl_select_cache_begin();
@@ -688,8 +690,9 @@ static EditBone *get_nearest_editbonepoint(
rcti rect;
BLI_rcti_init_pt_radius(&rect, vc->mval, 12);
- const int hits12 = view3d_opengl_select(
- vc, buffer, MAXPICKBUF, &rect, select_mode, select_filter);
+ const int hits12 = view3d_opengl_select_with_id_filter(
+ vc, buffer, MAXPICKBUF, &rect, select_mode, select_filter, select_id_ignore);
+
if (hits12 == 1) {
hits = selectbuffer_ret_hits_12(buffer, hits12);
goto cache_end;
@@ -699,8 +702,13 @@ static EditBone *get_nearest_editbonepoint(
offs = 4 * hits12;
BLI_rcti_init_pt_radius(&rect, vc->mval, 5);
- const int hits5 = view3d_opengl_select(
- vc, buffer + offs, MAXPICKBUF - offs, &rect, select_mode, select_filter);
+ const int hits5 = view3d_opengl_select_with_id_filter(vc,
+ buffer + offs,
+ MAXPICKBUF - offs,
+ &rect,
+ select_mode,
+ select_filter,
+ select_id_ignore);
if (hits5 == 1) {
hits = selectbuffer_ret_hits_5(buffer, hits12, hits5);