diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-31 04:01:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-31 04:07:13 +0300 |
commit | 8c89790674901748cf04771dc2c5453815db1607 (patch) | |
tree | 1080bd2f35fe1d9260b63efb9e12f31a9b152835 /source/blender/editors/util | |
parent | 51bba03b319319d59f739673c3fafb71bc308e0d (diff) |
Fix T60660: Texture paint undo removes image
Diffstat (limited to 'source/blender/editors/util')
-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); |