diff options
Diffstat (limited to 'source/blender/editors/space_image/image_edit.c')
-rw-r--r-- | source/blender/editors/space_image/image_edit.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 0122e509c3b..68b1a9e4466 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -67,6 +67,30 @@ void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automati WM_main_add_notifier(NC_SPACE | ND_SPACE_IMAGE, NULL); } +void ED_space_image_sync(struct Main *bmain, struct Image *image, bool ignore_render_viewer) +{ + wmWindowManager *wm = (wmWindowManager *)bmain->wm.first; + LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { + const bScreen *screen = WM_window_get_active_screen(win); + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype != SPACE_IMAGE) { + continue; + } + SpaceImage *sima = (SpaceImage *)sl; + if (sima->pin) { + continue; + } + if (ignore_render_viewer && sima->image && + ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { + continue; + } + ED_space_image_set(bmain, sima, image, true); + } + } + } +} + void ED_space_image_auto_set(const bContext *C, SpaceImage *sima) { if (sima->mode != SI_MODE_UV || sima->pin) { |