[Bf-blender-cvs] [f772a4b8fa8] blender-v2.83-release: Fix: A few missing outliner selection sync tags

Nathan Craddock noreply at git.blender.org
Wed May 27 00:51:43 CEST 2020


Commit: f772a4b8fa87d537de6b579d5b4a72d1874818c3
Author: Nathan Craddock
Date:   Tue May 26 16:41:19 2020 -0600
Branches: blender-v2.83-release
https://developer.blender.org/rBf772a4b8fa87d537de6b579d5b4a72d1874818c3

Fix: A few missing outliner selection sync tags

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.

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

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

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

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 6e342b7ed47..916c26e7667 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -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;
 }
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 17970e8ed64..8813af4c197 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -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);
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index bc8f6d4e3ae..65d7e675be5 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -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)



More information about the Bf-blender-cvs mailing list