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-01-15 08:56:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-15 09:09:52 +0300
commitdf36e1c5dd3c5843bcdc58a7021c6defc25d56ad (patch)
treeaca2080f7d5e17d72f4119aa8d8ca9839e461bf6 /source/blender/editors/space_view3d/view3d_select.c
parentdedceb9395bb4383f7986540d6de551e4044640e (diff)
Fix T71091: Object restrict selection conflicts with pose selection
Support pose bone selection when the object has hide_select enabled. This is consistent with how all other modes work.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 85e9a2d7680..89baf60bd8c 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1785,7 +1785,13 @@ static int mixed_bones_object_selectbuffer_extended(ViewContext *vc,
return hits;
}
-/* returns basact */
+/**
+ * \param has_bones: When true, skip non-bone hits, also allow bases to be used
+ * that are visible but not select-able,
+ * since you may be in pose mode with an an unselect-able object.
+ *
+ * \return the active base or NULL.
+ */
static Base *mouse_select_eval_buffer(ViewContext *vc,
const uint *buffer,
int hits,
@@ -1827,7 +1833,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc,
base = FIRSTBASE(view_layer);
while (base) {
- if (BASE_SELECTABLE(v3d, base)) {
+ if (has_bones ? BASE_VISIBLE(v3d, base) : BASE_SELECTABLE(v3d, base)) {
if (base->object->runtime.select_id == selcol) {
break;
}
@@ -1844,7 +1850,8 @@ static Base *mouse_select_eval_buffer(ViewContext *vc,
while (base) {
/* skip objects with select restriction, to prevent prematurely ending this loop
* with an un-selectable choice */
- if ((base->flag & BASE_SELECTABLE) == 0) {
+ if (has_bones ? (base->flag & BASE_VISIBLE_VIEWLAYER) == 0 :
+ (base->flag & BASE_SELECTABLE) == 0) {
base = base->next;
if (base == NULL) {
base = FIRSTBASE(view_layer);
@@ -1854,7 +1861,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc,
}
}
- if (BASE_SELECTABLE(v3d, base)) {
+ if (has_bones ? BASE_VISIBLE(v3d, base) : BASE_SELECTABLE(v3d, base)) {
for (a = 0; a < hits; a++) {
if (has_bones) {
/* skip non-bone objects */