Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-02-04 23:39:42 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-03-02 15:58:34 +0300
commit83824947ba40c31a480819072b6f0fb2e7029a59 (patch)
treedb44a1a03247846ba42043ef1691f59f69bddac8 /source/blender/editors/space_node/node_draw.c
parent0d12e086f5dda74d43e3a2d011bfc848c95136de (diff)
Avoid node tree update tag when changed nodes which are not affecting result
This was we don't have re-compo or viewport re-rendering happening when changing nodes which are not connected to the output at all (for example when adding new nodes or changing settings for unconnected nodes). Only basic operations are covered for now. checks could be added to more tools when needed. Currently it's not fully optimal implementation, but seems to work fast enough. Don't see reliable alternative to that -- keeping tag in the node wouldn't work because of the node groups (which are probably already broken, but should be easy to solve with current approach). So guess it's more matter of optimizing path search from a node to output. Before processing forward let's check whether it's indeed something we want and whether the approach is indeed not fully bad. Reviewers: campbellbarton, mont29 Subscribers: sebastian_k Differential Revision: https://developer.blender.org/D1765
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index a4e2d5406f4..85c8f50fcd3 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -153,18 +153,27 @@ void ED_node_tag_update_id(ID *id)
}
}
-void ED_node_tag_update_nodetree(Main *bmain, bNodeTree *ntree)
+void ED_node_tag_update_nodetree(Main *bmain, bNodeTree *ntree, bNode *node)
{
if (!ntree)
return;
-
+
+ bool do_tag_update = true;
+ if (node != NULL) {
+ if (!node_connected_to_output(ntree, node)) {
+ do_tag_update = false;
+ }
+ }
+
/* look through all datablocks, to support groups */
- FOREACH_NODETREE(bmain, tntree, id) {
- /* check if nodetree uses the group */
- if (ntreeHasTree(tntree, ntree))
- ED_node_tag_update_id(id);
- } FOREACH_NODETREE_END
-
+ if (do_tag_update) {
+ FOREACH_NODETREE(bmain, tntree, id) {
+ /* check if nodetree uses the group */
+ if (ntreeHasTree(tntree, ntree))
+ ED_node_tag_update_id(id);
+ } FOREACH_NODETREE_END
+ }
+
if (ntree->type == NTREE_TEXTURE)
ntreeTexCheckCyclics(ntree);
}