diff options
author | Ton Roosendaal <ton@blender.org> | 2011-01-16 20:12:02 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-01-16 20:12:02 +0300 |
commit | 6ef1f23a33dffa1765c358b158ef18798d1ec3c0 (patch) | |
tree | 6da9cd598b9755661d0ed9713ca95ca334862967 /source/blender/nodes | |
parent | dbb5e5dec234e61584c999b21dc8a2c3f5050979 (diff) |
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.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/intern/TEX_nodes/TEX_output.c | 4 | ||||
-rw-r--r-- | source/blender/nodes/intern/TEX_util.c | 4 |
2 files changed, 6 insertions, 2 deletions
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; } |