Fix T62025: Outliner and viewport missing update after deleting object
authorDalai Felinto <dfelinto@gmail.com>
Fri, 1 Mar 2019 19:18:05 +0000 (16:18 -0300)
committerDalai Felinto <dfelinto@gmail.com>
Fri, 1 Mar 2019 19:28:20 +0000 (16:28 -0300)
Bug introduced on 012483b6e4a1453c3e990127db001617997a9d64.

Since we notify similar things when changing active and selected
objects, I believe we didn't notice this was missing a ND_OB_SELECT
notification before the small refactor to use the messenging system
exposed that bug.

source/blender/editors/space_outliner/outliner_tools.c

index 8aa8eb0..4b67c83 100644 (file)
@@ -1057,6 +1057,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
                DEG_relations_tag_update(bmain);
                str = "Delete Objects";
                DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
+               WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
                if (basact_prev != BASACT(view_layer)) {
                        WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
                        WM_msg_publish_rna_prop(mbus, &scene->id, view_layer, LayerObjects, active);
@@ -1086,7 +1087,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
                DEG_relations_tag_update(bmain);
                str = "Delete Object Hierarchy";
                DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
-               WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
+               WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
                if (basact_prev != BASACT(view_layer)) {
                        WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
                        WM_msg_publish_rna_prop(mbus, &scene->id, view_layer, LayerObjects, active);