diff options
author | Jacques Lucke <jacques@blender.org> | 2021-11-17 13:52:44 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-11-17 13:52:54 +0300 |
commit | f5dde382af8078a2e5265e7d6710df7cb1b320a0 (patch) | |
tree | 367bdf822149128d0566f02ec062207aa7c82719 /source/blender/nodes/intern/node_common.cc | |
parent | 83a4d51997f24a31631217f819f00a6db68fb0cb (diff) |
Cleanup: use same function for updating internal links for all nodes
Previously, node types had a callback that creates internal links. Pretty
much all nodes used the same callback though. The exceptions are the
reroute node (which probably shouldn't be mutable anyway) and some
input/output nodes that are not mutable.
Removing the callback helps with D13246, because it makes it easier
to reason about which internal links are created and when they change.
In the future, the internal links should be part of the node declaration.
Diffstat (limited to 'source/blender/nodes/intern/node_common.cc')
-rw-r--r-- | source/blender/nodes/intern/node_common.cc | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc index e5ec50858d9..b80cedc9352 100644 --- a/source/blender/nodes/intern/node_common.cc +++ b/source/blender/nodes/intern/node_common.cc @@ -251,26 +251,6 @@ void register_node_type_frame(void) /** \name Node Re-Route * \{ */ -/* simple, only a single input and output here */ -static void node_reroute_update_internal_links(bNodeTree *ntree, bNode *node) -{ - bNodeLink *link; - - /* Security check! */ - if (!ntree) { - return; - } - - link = (bNodeLink *)MEM_callocN(sizeof(bNodeLink), "internal node link"); - link->fromnode = node; - link->fromsock = (bNodeSocket *)node->inputs.first; - link->tonode = node; - link->tosock = (bNodeSocket *)node->outputs.first; - /* internal link is always valid */ - link->flag |= NODE_LINK_VALID; - BLI_addtail(&node->internal_links, link); -} - static void node_reroute_init(bNodeTree *ntree, bNode *node) { /* NOTE: Cannot use socket templates for this, since it would reset the socket type @@ -288,7 +268,6 @@ void register_node_type_reroute(void) node_type_base(ntype, NODE_REROUTE, "Reroute", NODE_CLASS_LAYOUT, 0); node_type_init(ntype, node_reroute_init); - node_type_internal_links(ntype, node_reroute_update_internal_links); nodeRegisterType(ntype); } |