Fix #114648: Compositor executes upon editing non-compositor trees

The compositor currently executes when editing node trees that are not
compositor related, like geometry and shader node trees.

That's because the node space listener always tags the compositor to
execute for any node edit notifier. To fix this, we add the ID of the
edited node tree as a reference to the edit notifier and only tag for
an update when the space tree matches the reference one.

Pull Request: https://projects.blender.org/blender/blender/pulls/114978
This commit is contained in:
Omar Emara
2023-11-17 08:52:47 +01:00
committed by Omar Emara
parent 54e1ee3905
commit 7ea54b7472
2 changed files with 4 additions and 2 deletions

View File

@@ -417,7 +417,7 @@ bool composite_node_editable(bContext *C)
static void send_notifiers_after_tree_change(ID *id, bNodeTree *ntree)
{
WM_main_add_notifier(NC_NODE | NA_EDITED, nullptr);
WM_main_add_notifier(NC_NODE | NA_EDITED, id);
if (ntree->type == NTREE_SHADER && id != nullptr) {
if (GS(id->name) == ID_MA) {

View File

@@ -616,7 +616,9 @@ static void node_area_listener(const wmSpaceTypeListenerParams *params)
break;
case NC_NODE:
if (wmn->action == NA_EDITED) {
node_area_tag_tree_recalc(snode, area);
if (wmn->reference == snode->id || snode->id == nullptr) {
node_area_tag_tree_recalc(snode, area);
}
}
else if (wmn->action == NA_SELECTED) {
ED_area_tag_redraw(area);