diff options
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 1d56ef24403..ad07f8c6a8f 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -59,6 +59,7 @@ #include "BKE_screen.h" #include "BKE_undo_system.h" #include "BKE_workspace.h" +#include "BKE_material.h" #include "ED_armature.h" #include "ED_buttons.h" @@ -85,6 +86,24 @@ /* ********* general editor util funcs, not BKE stuff please! ********* */ +void ED_editors_init_for_undo(Main *bmain) +{ + wmWindowManager *wm = bmain->wm.first; + for (wmWindow *win = wm->windows.first; win; win = win->next) { + ViewLayer *view_layer = WM_window_get_active_view_layer(win); + Base *base = BASACT(view_layer); + if (base != NULL) { + Object *ob = base->object; + if (ob->mode & OB_MODE_TEXTURE_PAINT) { + Scene *scene = WM_window_get_active_scene(win); + + BKE_texpaint_slots_refresh_object(scene, ob); + BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); + } + } + } +} + void ED_editors_init(bContext *C) { struct Depsgraph *depsgraph = CTX_data_depsgraph(C); |