[Bf-blender-cvs] [801e973aa8f] soc-2019-outliner: Outliner: Redraw 3D view after syncing selection

Nathan Craddock noreply at git.blender.org
Sat Jun 22 07:08:51 CEST 2019


Commit: 801e973aa8fecdf75a75a97f547f0559ba53ed31
Author: Nathan Craddock
Date:   Fri Jun 21 23:07:50 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB801e973aa8fecdf75a75a97f547f0559ba53ed31

Outliner: Redraw 3D view after syncing selection

After deselect all in the outliner, the 3D view needs to be redrawn.
Also fix some syncing edge cases

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

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 e05d405c458..7396d458939 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1354,9 +1354,11 @@ static void do_outliner_selection_sync_recursive(SpaceOutliner *soops,
         const bool is_selected = (tselem->flag & TSE_SELECTED) != 0;
 
         if (is_selected) {
-
           base->flag |= BASE_SELECTED;
         }
+        else {
+          base->flag &= ~BASE_SELECTED;
+        }
       }
       else {
         const bool is_selected = (base != NULL) && ((base->flag & BASE_SELECTED) != 0);
@@ -1375,6 +1377,7 @@ static void do_outliner_selection_sync_recursive(SpaceOutliner *soops,
 
 void do_outliner_selection_sync(const bContext *C, bool to_view_layer)
 {
+  Scene *scene = CTX_data_scene(C);
   ViewLayer *view_layer = CTX_data_view_layer(C);
   SpaceOutliner *soops = CTX_wm_space_outliner(C);
 
@@ -1400,6 +1403,10 @@ void do_outliner_selection_sync(const bContext *C, bool to_view_layer)
         }
       }
     }
+
+    /* Redraw 3D view */
+    DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
+    WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
   }
 }
 
@@ -1421,9 +1428,6 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
   float view_mval[2];
   bool changed = false, rebuild_tree = false;
 
-  // Set dirty
-  soops->flag |= SO_IS_DIRTY;
-
   UI_view2d_region_to_view(&ar->v2d, mval[0], mval[1], &view_mval[0], &view_mval[1]);
 
   if (outliner_is_co_within_restrict_columns(soops, ar, view_mval[0])) {
@@ -1564,7 +1568,8 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op)
   WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
   ED_region_tag_redraw(ar);
 
-  if ((soops->flag & SO_SYNC_SELECTION) != 0) {
+  /* Sync selection */
+  if (soops->flag & SO_SYNC_SELECTION) {
     do_outliner_selection_sync(C, true);
   }



More information about the Bf-blender-cvs mailing list