From 5e370ee643529cd6afa962ea009a4827bb031361 Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Fri, 1 Dec 2023 15:13:04 +0100 Subject: [PATCH] Fix: Missing compositor update upon changing tree options The compositor doesn't run when changing node tree options. That was due to a nullptr notifier reference for RNA node tree edits. This patch uses the node tree ID for the notifier reference. Additionally, the listener code was extended to always tag the node tree when the reference is null, which converts missing updates issues like this one to superfluous updates, since it is safer. Pull Request: https://projects.blender.org/blender/blender/pulls/115532 --- source/blender/editors/space_node/space_node.cc | 2 +- source/blender/makesrna/intern/rna_nodetree.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc index 84c2a8a3490..c1321dd723a 100644 --- a/source/blender/editors/space_node/space_node.cc +++ b/source/blender/editors/space_node/space_node.cc @@ -616,7 +616,7 @@ static void node_area_listener(const wmSpaceTypeListenerParams *params) break; case NC_NODE: if (wmn->action == NA_EDITED) { - if (wmn->reference == snode->id || snode->id == nullptr) { + if (ELEM(wmn->reference, snode->nodetree, snode->id, nullptr) || snode->id == nullptr) { node_area_tag_tree_recalc(snode, area); } } diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 63bcc546821..8febc4fbcbf 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -1054,7 +1054,7 @@ static void rna_NodeTree_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr) { bNodeTree *ntree = reinterpret_cast(ptr->owner_id); - WM_main_add_notifier(NC_NODE | NA_EDITED, nullptr); + WM_main_add_notifier(NC_NODE | NA_EDITED, &ntree->id); WM_main_add_notifier(NC_SCENE | ND_NODES, &ntree->id); ED_node_tree_propagate_change(nullptr, bmain, ntree);