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/space_view3d/view3d_view.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/space_view3d/view3d_view.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index fe77ca05a04..3fc990160d2 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1192,6 +1192,24 @@ finally:
return hits;
}
+int view3d_opengl_select_with_id_filter(ViewContext *vc,
+ uint *buffer,
+ uint bufsize,
+ const rcti *input,
+ eV3DSelectMode select_mode,
+ eV3DSelectObjectFilter select_filter,
+ uint select_id)
+{
+ int hits = view3d_opengl_select(vc, buffer, bufsize, input, select_mode, select_filter);
+
+ /* Selection sometimes uses -1 for an invalid selection ID, remove these as they
+ * interfere with detection of actual number of hits in the selection. */
+ if (hits > 0) {
+ hits = GPU_select_buffer_remove_by_id(buffer, hits, select_id);
+ }
+ return hits;
+}
+
/** \} */
/* -------------------------------------------------------------------- */