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>2017-08-29 13:51:56 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-08-29 13:58:55 +0300
commitf84684694113f60e9d8de5e30c7af8f340e52106 (patch)
treeaa11c7b4a602f4ae9e061d8c9fe30c0403afd982 /source/blender/blenkernel/intern/node.c
parentc1582667cabe025bd3a1ee4a3db27e2b3fd9e42a (diff)
Depsgraph: Fix missing updates when tweaking node tree parameters
The is following: split copy on write update for node trees, and if we are only tagging for uniform buffer update we skip whole datablock copy and only invoke copy default_values form original nodetree to a copied one. Thing which i'm not sure is: whether we need to use different branches in graph itself to control such a conditional behavior, or whether we need to store tag somewhere in the dependency graph. There are obviously cons and pros in both approaches, and need to think about this. Maybe with more examples it becomes more obvious which way is better. This only fixes manual tweaks for now, animation support is coming.
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r--source/blender/blenkernel/intern/node.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 1c24d72759e..3ff4885f7fc 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -3826,6 +3826,9 @@ static void node_copy_default_values(bNode *node_dst, const bNode *node_src)
void BKE_nodetree_copy_default_values(bNodeTree *ntree_dst,
const bNodeTree *ntree_src)
{
+ if (ntree_dst == ntree_src) {
+ return;
+ }
bNode *node_dst = ntree_dst->nodes.first;
const bNode *node_src = ntree_src->nodes.first;
while (node_dst != NULL) {
@@ -3834,3 +3837,13 @@ void BKE_nodetree_copy_default_values(bNodeTree *ntree_dst,
node_src = node_src->next;
}
}
+
+void BKE_nodetree_shading_params_eval(const struct EvaluationContext *UNUSED(eval_ctx),
+ bNodeTree *ntree_dst,
+ const bNodeTree *ntree_src)
+{
+ if (G.debug & G_DEBUG_DEPSGRAPH) {
+ printf("%s on %s (%p)\n", __func__, ntree_src->id.name, ntree_dst);
+ }
+ BKE_nodetree_copy_default_values(ntree_dst, ntree_src);
+}