From 59a38ccc4239a407e8954abd2250a68540a84e59 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 17 Sep 2014 18:27:05 +0200 Subject: Fix T41761, muting not working with texture nodes This was disabled to fix T41349, however seems that if we don't pass delegates for muted nodes everything work fine. --- source/blender/nodes/texture/node_texture_tree.c | 2 +- source/blender/nodes/texture/node_texture_util.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'source/blender/nodes/texture') diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c index 02f15705ad1..1b790f87faf 100644 --- a/source/blender/nodes/texture/node_texture_tree.c +++ b/source/blender/nodes/texture/node_texture_tree.c @@ -140,7 +140,7 @@ static void foreach_nodeclass(Scene *UNUSED(scene), void *calldata, bNodeClassCa /* XXX muting disabled in previews because of threading issues with the main execution * it works here, but disabled for consistency */ -#if 0 +#if 1 static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree)) { bNode *node, *node_next; diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c index e01b7ec49f1..42c684b8247 100644 --- a/source/blender/nodes/texture/node_texture_util.c +++ b/source/blender/nodes/texture/node_texture_util.c @@ -140,11 +140,19 @@ void tex_do_preview(bNodePreview *preview, const float coord[2], const float col void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *cdata) { TexDelegate *dg; - if (!out->data) - /* Freed in tex_end_exec (node.c) */ - dg = out->data = MEM_mallocN(sizeof(TexDelegate), "tex delegate"); - else - dg = out->data; + + if (node->flag & NODE_MUTED) { + /* do not add a delegate if the node is muted */ + return; + } + else { + if (!out->data) + /* Freed in tex_end_exec (node.c) */ + dg = out->data = MEM_mallocN(sizeof(TexDelegate), "tex delegate"); + else + dg = out->data; + } + dg->cdata = cdata; dg->fn = texfn; -- cgit v1.2.3