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
This commit is contained in:
Omar Emara
2023-12-01 15:13:04 +01:00
committed by Omar Emara
parent fe848ce3ef
commit 5e370ee643
2 changed files with 2 additions and 2 deletions

View File

@@ -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);
}
}

View File

@@ -1054,7 +1054,7 @@ static void rna_NodeTree_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(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);