[Bf-blender-cvs] [59a38cc] master: Fix T41761, muting not working with texture nodes

Antony Riakiotakis noreply at git.blender.org
Wed Sep 17 19:05:43 CEST 2014


Commit: 59a38ccc4239a407e8954abd2250a68540a84e59
Author: Antony Riakiotakis
Date:   Wed Sep 17 18:27:05 2014 +0200
Branches: master
https://developer.blender.org/rB59a38ccc4239a407e8954abd2250a68540a84e59

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.

===================================================================

M	source/blender/nodes/intern/node_exec.c
M	source/blender/nodes/texture/node_texture_tree.c
M	source/blender/nodes/texture/node_texture_util.c

===================================================================

diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index 0893d20..9529e08 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -160,7 +160,6 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNo
 	bNode **nodelist;
 	int totnodes, n;
 	/* XXX texnodes have threading issues with muting, have to disable it there ... */
-	bool use_muting = (ntree->type != NTREE_TEXTURE);
 	
 	/* ensure all sock->link pointers and node levels are correct */
 	ntreeUpdateTree(G.main, ntree);
@@ -184,7 +183,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNo
 		for (sock = node->inputs.first; sock; sock = sock->next)
 			node_init_input_index(sock, &index);
 		
-		if (use_muting && (node->flag & NODE_MUTED || node->type == NODE_REROUTE)) {
+		if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) {
 			for (sock = node->outputs.first; sock; sock = sock->next)
 				node_init_output_index(sock, &index, &node->internal_links);
 		}
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c
index 02f1570..1b790f87 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 e01b7ec..42c684b 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;




More information about the Bf-blender-cvs mailing list