Fix: A few missing outliner selection sync tags
authorNathan Craddock <nzcraddock@gmail.com>
Tue, 26 May 2020 22:41:19 +0000 (16:41 -0600)
committerNathan Craddock <nzcraddock@gmail.com>
Tue, 26 May 2020 22:42:21 +0000 (16:42 -0600)
Add selection syncing for object add named (e.g. drag and drop from
outliner to 3D view), outliner right click (a sync when the context menu
is cancelled), and for object selection from Python.

source/blender/editors/object/object_add.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/makesrna/intern/rna_object_api.c

index 6e342b7ed47955e7d9a84b56223f47cf339bba97..916c26e7667f70723f8c9c96d6a19d2c049b6a0a 100644 (file)
@@ -2859,6 +2859,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
   DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
   WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
   WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
+  ED_outliner_select_sync_from_object_tag(C);
 
   return OPERATOR_FINISHED;
 }
index 17970e8ed6474615ba75b4be10918a5b29966d32..8813af4c197be9dd0a63c380e1c5d259c1ec4ef9 100644 (file)
@@ -2382,6 +2382,7 @@ static int do_outliner_operation_event(
       /* Only redraw, don't rebuild here because TreeElement pointers will
        * become invalid and operations will crash. */
       ED_region_tag_redraw_no_rebuild(region);
+      ED_outliner_select_sync_from_outliner(C, soops);
     }
 
     set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
index bc8f6d4e3aea85ab16dd4ea9806134c91a79dc9f..65d7e675be58e7c4671ff5b0a3a58c53fe2c542f 100644 (file)
@@ -41,6 +41,8 @@
 
 #include "DEG_depsgraph.h"
 
+#include "ED_outliner.h"
+
 #include "rna_internal.h" /* own include */
 
 static const EnumPropertyItem space_items[] = {
@@ -114,6 +116,7 @@ static void rna_Object_select_set(
   Scene *scene = CTX_data_scene(C);
   DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
   WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene);
+  ED_outliner_select_sync_from_object_tag(C);
 }
 
 static bool rna_Object_select_get(Object *ob, bContext *C, ViewLayer *view_layer)