diff options
author | Edward <edward88> | 2022-11-08 16:28:44 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-11-08 16:28:44 +0300 |
commit | 1d71f82033f1ec3ad51195cfa64c59fcf0cd6ccc (patch) | |
tree | 7d95ebd00daabc5f25e94ede3dde3efc7a2662e9 /source/blender/editors/space_node/node_edit.cc | |
parent | 77c4d3154b82ac009598819dda9b7e2fd7cd414f (diff) |
Texture Paint: sync adding a new texture slot to the Image Editor
When changing the texture paint slot index or activating a Texture Node, the texture displayed in the Image Editor changes accordingly.
This patch syncs the Image Editor when a new texture paint slot was added, which currently is not the case.
Also deduplicates some code.
Diffstat (limited to 'source/blender/editors/space_node/node_edit.cc')
-rw-r--r-- | source/blender/editors/space_node/node_edit.cc | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 192ba2771f4..7982b47f363 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -737,26 +737,7 @@ void ED_node_set_active( * - current image is not a Render Result or ViewerNode (want to keep looking at these) */ if (node->id != nullptr && GS(node->id->name) == ID_IM) { Image *image = (Image *)node->id; - 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 (sima->image && - ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { - continue; - } - ED_space_image_set(bmain, sima, image, true); - } - } - } + ED_space_image_sync(bmain, image, true); } if (r_active_texture_changed) { |