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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user