diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-14 13:14:21 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-14 13:15:55 +0300 |
commit | 90a8aa2dab381f21704c3199d4fcd8ed64e059ce (patch) | |
tree | 92ed038463fc544b4a456499c6e3b43976f7db6b /source/blender/blenkernel/intern | |
parent | dd5d31b515c12136959a97893a264e32066ab326 (diff) |
Fix T43201: Update the "in use" flags of sockets before drawing,
so value buttons are displayed when the link is not used.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 7414a8588ee..039af949d81 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2881,7 +2881,7 @@ static void ntree_update_node_level(bNodeTree *ntree) } } -static void ntree_update_link_pointers(bNodeTree *ntree) +void ntreeTagUsedSockets(bNodeTree *ntree) { bNode *node; bNodeSocket *sock; @@ -2890,22 +2890,43 @@ static void ntree_update_link_pointers(bNodeTree *ntree) /* first clear data */ for (node = ntree->nodes.first; node; node = node->next) { for (sock = node->inputs.first; sock; sock = sock->next) { - sock->link = NULL; sock->flag &= ~SOCK_IN_USE; } for (sock = node->outputs.first; sock; sock = sock->next) { sock->flag &= ~SOCK_IN_USE; } } - + for (link = ntree->links.first; link; link = link->next) { - link->tosock->link = link; + /* link is unused if either side is disabled */ + if ((link->fromsock->flag & SOCK_UNAVAIL) || (link->tosock->flag & SOCK_UNAVAIL)) + continue; link->fromsock->flag |= SOCK_IN_USE; link->tosock->flag |= SOCK_IN_USE; } } +static void ntree_update_link_pointers(bNodeTree *ntree) +{ + bNode *node; + bNodeSocket *sock; + bNodeLink *link; + + /* first clear data */ + for (node = ntree->nodes.first; node; node = node->next) { + for (sock = node->inputs.first; sock; sock = sock->next) { + sock->link = NULL; + } + } + + for (link = ntree->links.first; link; link = link->next) { + link->tosock->link = link; + } + + ntreeTagUsedSockets(ntree); +} + static void ntree_validate_links(bNodeTree *ntree) { bNodeLink *link; |