Fix for object.set_select not updating selection in viewport
authorDalai Felinto <dfelinto@gmail.com>
Thu, 1 Nov 2018 12:25:40 +0000 (12:25 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Thu, 1 Nov 2018 12:43:48 +0000 (12:43 +0000)
Note: This function changes the active object as well. Not sure it
should do.

source/blender/makesrna/intern/rna_object_api.c

index 458c26f702647c190d04b45eaa824124d62c6663..bba6918044a3f1cf9fac9ed5537db1347d3542f5 100644 (file)
@@ -120,6 +120,11 @@ static void rna_Object_select_set(Object *ob, bContext *C, ReportList *reports,
                        BKE_view_layer_base_select(view_layer, base);
                        break;
        }
+
+       Scene *scene = CTX_data_scene(C);
+       DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+       WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene);
+       WM_main_add_notifier(NC_SCENE | ND_OB_ACTIVE, scene);
 }
 
 static bool rna_Object_select_get(Object *ob, bContext *C, ReportList *reports)