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/draw/intern/draw_manager.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/draw/intern/draw_manager.c')
-rw-r--r--source/blender/draw/intern/draw_manager.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 3174edb0c05..2fbb0a740cf 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2254,6 +2254,10 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph,
FOREACH_OBJECT_IN_MODE_END;
}
else {
+ /* When selecting pose-bones in pose mode, check for visibility not select-ability
+ * as pose-bones have their own selection restriction flag. */
+ const bool use_pose_exception = (DST.draw_ctx.object_pose != NULL);
+
const int object_type_exclude_select = (v3d->object_type_exclude_viewport |
v3d->object_type_exclude_select);
bool filter_exclude = false;
@@ -2261,8 +2265,19 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph,
if (!BKE_object_is_visible_in_viewport(v3d, ob)) {
continue;
}
- if ((ob->base_flag & BASE_SELECTABLE) &&
- (object_type_exclude_select & (1 << ob->type)) == 0) {
+
+ if (use_pose_exception && (ob->mode & OB_MODE_POSE)) {
+ if ((ob->base_flag & BASE_VISIBLE_VIEWLAYER) == 0) {
+ continue;
+ }
+ }
+ else {
+ if ((ob->base_flag & BASE_SELECTABLE) == 0) {
+ continue;
+ }
+ }
+
+ if ((object_type_exclude_select & (1 << ob->type)) == 0) {
if (object_filter_fn != NULL) {
if (ob->base_flag & BASE_FROM_DUPLI) {
/* pass (use previous filter_exclude value) */