[Bf-blender-cvs] [8953485f561] blender-v2.91-release: Fix: Selection not possible from outliner gutter

Nathan Craddock noreply at git.blender.org
Wed Nov 11 01:33:15 CET 2020


Commit: 8953485f5612f6ddf1ce7be2320b349383caefdd
Author: Nathan Craddock
Date:   Tue Nov 10 17:21:11 2020 -0700
Branches: blender-v2.91-release
https://developer.blender.org/rB8953485f5612f6ddf1ce7be2320b349383caefdd

Fix: Selection not possible from outliner gutter

Selection should be possible from the left gutter in object mode. When
in other modes the mode column displays icon buttons which should be
prioritized for selection only in those modes.

Introduced in rB2110af20f5e6.

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

M	source/blender/editors/space_outliner/outliner_select.c

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

diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 688f6d646ff..aebb574578f 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1312,6 +1312,17 @@ bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const floa
   return space_outliner->flag & SO_MODE_COLUMN && view_mval[0] < UI_UNIT_X;
 }
 
+static bool outliner_is_co_within_active_mode_column(bContext *C,
+                                                     SpaceOutliner *space_outliner,
+                                                     const float view_mval[2])
+{
+  ViewLayer *view_layer = CTX_data_view_layer(C);
+  Object *obact = OBACT(view_layer);
+
+  return outliner_is_co_within_mode_column(space_outliner, view_mval) && obact &&
+         obact->mode != OB_MODE_OBJECT;
+}
+
 /**
  * Action to run when clicking in the outliner,
  *
@@ -1334,7 +1345,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
   if (outliner_is_co_within_restrict_columns(space_outliner, region, view_mval[0])) {
     return OPERATOR_CANCELLED;
   }
-  if (outliner_is_co_within_mode_column(space_outliner, view_mval)) {
+  if (outliner_is_co_within_active_mode_column(C, space_outliner, view_mval)) {
     return OPERATOR_CANCELLED;
   }
 
@@ -1504,7 +1515,7 @@ static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent
     return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
   }
 
-  if (outliner_is_co_within_mode_column(space_outliner, view_mval)) {
+  if (outliner_is_co_within_active_mode_column(C, space_outliner, view_mval)) {
     return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
   }



More information about the Bf-blender-cvs mailing list