From ae3073323e92a1773fb253bd1c5d6c92b826e1e0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Nov 2022 18:37:25 +1100 Subject: Cleanup: use bool instead of short for job stop & do_update arguments Since these values are only ever 0/1, use bool type. --- source/blender/editors/space_node/node_edit.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_node/node_edit.cc') diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 48b3d711bdf..e6eba45d45e 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -89,8 +89,8 @@ struct CompoJob { Depsgraph *compositor_depsgraph; bNodeTree *localtree; /* Jon system integration. */ - const short *stop; - short *do_update; + const bool *stop; + bool *do_update; float *progress; }; @@ -166,7 +166,7 @@ static int compo_get_recalc_flags(const bContext *C) } /* called by compo, only to check job 'stop' value */ -static int compo_breakjob(void *cjv) +static bool compo_breakjob(void *cjv) { CompoJob *cj = (CompoJob *)cjv; @@ -250,8 +250,8 @@ static void compo_progressjob(void *cjv, float progress) static void compo_startjob(void *cjv, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { CompoJob *cj = (CompoJob *)cjv; -- cgit v1.2.3 From c842a5a187168542f68fe06efcb212fab717e8d0 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 7 Nov 2022 15:48:32 +0100 Subject: Fix T101526: assert due to wrong node tree owner id --- source/blender/editors/space_node/node_edit.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/space_node/node_edit.cc') diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 48b3d711bdf..c6aeda8c9ab 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -502,6 +502,7 @@ void ED_node_shader_default(const bContext *C, ID *id) } ma->nodetree = ntreeCopyTree(bmain, ma_default->nodetree); + ma->nodetree->owner_id = &ma->id; BKE_ntree_update_main_tree(bmain, ma->nodetree, nullptr); } else if (ELEM(GS(id->name), ID_WO, ID_LA)) { -- cgit v1.2.3 From 1d71f82033f1ec3ad51195cfa64c59fcf0cd6ccc Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 8 Nov 2022 14:28:44 +0100 Subject: 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. --- source/blender/editors/space_node/node_edit.cc | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'source/blender/editors/space_node/node_edit.cc') 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) { -- cgit v1.2.3