diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-22 23:00:17 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-22 23:00:34 +0300 |
commit | b4f978e9011d6c14f73ad871c77b1a325769e7c5 (patch) | |
tree | babb59d9d834cd1678febde0471037b7dadbb824 | |
parent | 586e2face61c2c05b46ccf13889e2153faba0078 (diff) |
Fix: Missing update when toggling node mute
Toggling node mute doesn't cause node trees to reevaluate after
rB7e712b2d6a0d257. Toggling a link mute still works though. To fix this,
the operator tags the node and node with a new update tag function
(that uses an existing tag internally).
Differential Revision: https://developer.blender.org/D13653
-rw-r--r-- | source/blender/blenkernel/BKE_node_tree_update.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node_tree_update.cc | 5 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.cc | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node_tree_update.h b/source/blender/blenkernel/BKE_node_tree_update.h index ebaa56c89c9..d549eec2247 100644 --- a/source/blender/blenkernel/BKE_node_tree_update.h +++ b/source/blender/blenkernel/BKE_node_tree_update.h @@ -46,6 +46,7 @@ void BKE_ntree_update_tag_all(struct bNodeTree *ntree); void BKE_ntree_update_tag_node_property(struct bNodeTree *ntree, struct bNode *node); void BKE_ntree_update_tag_node_new(struct bNodeTree *ntree, struct bNode *node); void BKE_ntree_update_tag_node_removed(struct bNodeTree *ntree); +void BKE_ntree_update_tag_node_mute(struct bNodeTree *ntree, struct bNode *node); void BKE_ntree_update_tag_node_internal_link(struct bNodeTree *ntree, struct bNode *node); void BKE_ntree_update_tag_socket_property(struct bNodeTree *ntree, struct bNodeSocket *socket); diff --git a/source/blender/blenkernel/intern/node_tree_update.cc b/source/blender/blenkernel/intern/node_tree_update.cc index 427fac747dc..abdc2dfeabf 100644 --- a/source/blender/blenkernel/intern/node_tree_update.cc +++ b/source/blender/blenkernel/intern/node_tree_update.cc @@ -1571,6 +1571,11 @@ void BKE_ntree_update_tag_node_removed(bNodeTree *ntree) add_tree_tag(ntree, NTREE_CHANGED_REMOVED_NODE); } +void BKE_ntree_update_tag_node_mute(bNodeTree *ntree, bNode *node) +{ + add_node_tag(ntree, node, NTREE_CHANGED_NODE_PROPERTY); +} + void BKE_ntree_update_tag_node_internal_link(bNodeTree *ntree, bNode *node) { add_node_tag(ntree, node, NTREE_CHANGED_INTERNAL_LINK); diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index b9b843c5a4a..7539f4cf70b 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -1734,6 +1734,7 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op)) LISTBASE_FOREACH (bNode *, node, &snode->edittree->nodes) { if ((node->flag & SELECT) && !node->typeinfo->no_muting) { node->flag ^= NODE_MUTED; + BKE_ntree_update_tag_node_mute(snode->edittree, node); } } |