Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2022-08-22 11:07:03 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-08-23 12:07:08 +0300
commitc76d7f7bde351b030863cbb999ad9e6cefd35fbe (patch)
tree608ef2b871af89684808f1d0fb5a6d59c2f1c183 /source/blender
parent5d67b524412d0dab936170eef65c508930ba4c30 (diff)
Fix T99493: better syncing between Node Editor and Image Editor
Since {rBb0cb0a785475}, changing the active texture in the Node Editor would also change the current image in the Image Editor. While this was an overall improvement, this was not desired when the image currently looked at was a `Render Result` or a `Viewer Node` (artists usually want to keep focus on these). With this patch, syncing the active texture change from the Node Editor to the Image Editor will now only happen if the Image Editor's current image is not a Render Result or a Viewer Node. NOTE: Syncing the active paint slot to the Image Editor still happens (even if the Image Editor's current image is not a Render Result or a Viewer Node), behavior was not changed since this is a much more explicit action while texture painting and probably desired in that case. Maniphest Tasks: T99493 Differential Revision: https://developer.blender.org/D15749
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_node/node_edit.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc
index 1e01373029d..35ff8468a14 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -729,19 +729,26 @@ void ED_node_set_active(
}
}
- /* Sync to Image Editor. */
+ /* Sync to Image Editor under the following conditions:
+ * - current image is not pinned
+ * - current image is not a Render Result or ViewerNode (want to keep looking at these) */
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) {
- SpaceImage *sima = (SpaceImage *)sl;
- if (!sima->pin) {
- ED_space_image_set(bmain, sima, image, true);
- }
+ if (sl->spacetype != SPACE_IMAGE) {
+ continue;
+ }
+ SpaceImage *sima = (SpaceImage *)sl;
+ if (sima->pin) {
+ continue;
+ }
+ if (ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
+ continue;
}
+ ED_space_image_set(bmain, sima, image, true);
}
}
}