diff options
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 37 |
2 files changed, 21 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index dc1f80ce1d4..272df18c73d 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -56,7 +56,6 @@ #include "BKE_fcurve.h" #include "BKE_node.h" #include "BKE_utildefines.h" -#include "BKE_node.h" #include "PIL_time.h" diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 3877e7abf5e..4b193011467 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -460,6 +460,19 @@ void snode_set_context(SpaceNode *snode, Scene *scene) node_tree_from_ID(snode->id, &snode->nodetree, &snode->edittree, NULL); } +static void snode_tag_changed(SpaceNode *snode, bNode *node) +{ + bNode *gnode; + + if (node) + NodeTagChanged(snode->edittree, node); + + /* if inside group, tag entire group */ + gnode= node_tree_get_editgroup(snode->nodetree); + if(gnode) + NodeTagIDChanged(snode->nodetree, gnode->id); +} + void node_set_active(SpaceNode *snode, bNode *node) { nodeSetActive(snode->edittree, node); @@ -508,14 +521,7 @@ void node_set_active(SpaceNode *snode, bNode *node) node->flag |= NODE_DO_OUTPUT; if(was_output==0) { - bNode *gnode; - - NodeTagChanged(snode->edittree, node); - - /* if inside group, tag entire group */ - gnode= node_tree_get_editgroup(snode->nodetree); - if(gnode) - NodeTagIDChanged(snode->nodetree, gnode->id); + snode_tag_changed(snode, node); ED_node_changed_update(snode->id, node); } @@ -1553,7 +1559,7 @@ static void node_link_viewer(SpaceNode *snode, bNode *tonode) link->fromsock= sock; } ntreeSolveOrder(snode->edittree); - NodeTagChanged(snode->edittree, node); + snode_tag_changed(snode, node); } } } @@ -1896,7 +1902,7 @@ void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace) if (replace) nodeRemSocketLinks(snode->edittree, sock_to); nodeAddLink(snode->edittree, node_fr, sock_fr, node_to, sock_to); - NodeTagChanged(snode->edittree, node_to); + snode_tag_changed(snode, node_to); ++numlinks; break; } @@ -1960,7 +1966,7 @@ bNode *node_add_node(SpaceNode *snode, Scene *scene, int type, float locx, float if(node->id) id_us_plus(node->id); - NodeTagChanged(snode->edittree, node); + snode_tag_changed(snode, node); } if(snode->nodetree->type==NTREE_TEXTURE) { @@ -2135,8 +2141,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) case MIDDLEMOUSE: if(link->tosock && link->fromsock) { /* send changed events for original tonode and new */ - if(link->tonode) - NodeTagChanged(snode->edittree, link->tonode); + snode_tag_changed(snode, link->tonode); /* we might need to remove a link */ if(in_out==SOCK_OUT) @@ -2209,7 +2214,7 @@ static int node_link_init(SpaceNode *snode, bNodeLinkDrag *nldrag) if(link) { /* send changed event to original tonode */ if(link->tonode) - NodeTagChanged(snode->edittree, link->tonode); + snode_tag_changed(snode, link->tonode); nldrag->node= link->fromnode; nldrag->sock= link->fromsock; @@ -2363,7 +2368,7 @@ static int cut_links_exec(bContext *C, wmOperator *op) next= link->next; if(cut_links_intersect(link, mcoords, i)) { - NodeTagChanged(snode->edittree, link->tonode); + snode_tag_changed(snode, link->tonode); nodeRemLink(snode->edittree, link); } } @@ -2746,7 +2751,7 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op)) if(node->flag & SELECT) { if(node->inputs.first && node->outputs.first) { node->flag ^= NODE_MUTED; - NodeTagChanged(snode->edittree, node); + snode_tag_changed(snode, node); } } } |