From 6ef1f23a33dffa1765c358b158ef18798d1ec3c0 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 16 Jan 2011 17:12:02 +0000 Subject: Bugfix, IRC report Texture nodes: including output node in group crashed when it got connected. Note that this feature is not supported to do anything else than temporarily giving an output when editing node groups. --- source/blender/nodes/intern/TEX_nodes/TEX_output.c | 4 ++-- source/blender/nodes/intern/TEX_util.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/nodes/intern') diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c index 26733a94180..1be2e8f1c56 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c @@ -45,7 +45,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o TexParams params; params_from_cdata(¶ms, cdata); - if(in[1]->hasinput && !in[0]->hasinput) + if(in[1] && in[1]->hasinput && !in[0]->hasinput) tex_input_rgba(&target->tr, in[1], ¶ms, cdata->thread); else tex_input_rgba(&target->tr, in[0], ¶ms, cdata->thread); @@ -63,7 +63,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o target->talpha = 1.0f; if(target->nor) { - if(in[1]->hasinput) + if(in[1] && in[1]->hasinput) tex_input_vec(target->nor, in[1], ¶ms, cdata->thread); else target->nor = 0; diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index 38f2cd1a306..d288b13a66c 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -181,6 +181,7 @@ int ntreeTexExecTree( MTex *mtex ){ TexCallData data; + float *nor= texres->nor; int retval = TEX_INT; data.co = co; @@ -199,6 +200,9 @@ int ntreeTexExecTree( if(texres->nor) retval |= TEX_NOR; retval |= TEX_RGB; + /* confusing stuff; the texture output node sets this to NULL to indicate no normal socket was set + however, the texture code checks this for other reasons (namely, a normal is required for material) */ + texres->nor= nor; return retval; } -- cgit v1.2.3