diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-20 21:25:22 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-24 13:44:27 +0300 |
commit | d730e512ac56bd68c75f8c44ff186b51010db4c7 (patch) | |
tree | dddf69daf78ac1627db7069ef3012b8ecb54017f /source/blender/editors/space_node | |
parent | 62421470ee09fb70f343eb9fd48b093316c8eea1 (diff) |
Nodes: avoid slow and unecessary node group updates on file read
On file read we need to update group nodes in case the group they refer to
has changed its inputs and outputs. This had O(n^2) time complexity and was
updating all datablocks even if they did not change.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/node_group.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 3c65c4854b8..08328681f7a 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -823,8 +823,8 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree, /* update the group node and interface node sockets, * so the new interface socket can be linked. */ - node_group_verify(ntree, gnode, (ID *)ngroup); - node_group_input_verify(ngroup, input_node, (ID *)ngroup); + node_group_update(ntree, gnode); + node_group_input_update(ngroup, input_node); /* create new internal link */ input_sock = node_group_input_find_socket(input_node, iosock->identifier); @@ -857,8 +857,8 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree, /* update the group node and interface node sockets, * so the new interface socket can be linked. */ - node_group_verify(ntree, gnode, (ID *)ngroup); - node_group_output_verify(ngroup, output_node, (ID *)ngroup); + node_group_update(ntree, gnode); + node_group_output_update(ngroup, output_node); /* create new internal link */ output_sock = node_group_output_find_socket(output_node, iosock->identifier); @@ -898,7 +898,7 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree, iosock = ntreeAddSocketInterfaceFromSocket(ngroup, node, sock); - node_group_input_verify(ngroup, input_node, (ID *)ngroup); + node_group_input_update(ngroup, input_node); /* create new internal link */ input_sock = node_group_input_find_socket(input_node, iosock->identifier); @@ -919,7 +919,7 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree, iosock = ntreeAddSocketInterfaceFromSocket(ngroup, node, sock); - node_group_output_verify(ngroup, output_node, (ID *)ngroup); + node_group_output_update(ngroup, output_node); /* create new internal link */ output_sock = node_group_output_find_socket(output_node, iosock->identifier); |