From b12a0199480f5d452828450fa257020635f7ad6d Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 24 Jan 2013 16:11:07 +0000 Subject: Usability - Cycles materials now render in Blender Internal too, skipping the nodes. Not very useful, but at least things then show up on renders and in previews. - Node editor: if wrong shader nodes are in a tree, they draw with thene color RED ALERT headers now. (Switching render engine will show it). --- source/blender/render/intern/source/shadeinput.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index db93a21de2d..c59c3685d7d 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -151,6 +151,7 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) /* do a shade, finish up some passes, apply mist */ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) { + int compat = 0; float alpha; /* ------ main shading loop -------- */ @@ -158,10 +159,11 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) memset(&shi->raycounter, 0, sizeof(shi->raycounter)); #endif - if (shi->mat->nodetree && shi->mat->use_nodes) { - ntreeShaderExecTree(shi->mat->nodetree, shi, shr); - } - else { + if (shi->mat->nodetree && shi->mat->use_nodes) + compat = ntreeShaderExecTree(shi->mat->nodetree, shi, shr); + + /* also run this when node shaders fail, due to incompatible shader nodes */ + if (compat == 0) { /* copy all relevant material vars, note, keep this synced with render_types.h */ shade_input_init_material(shi); -- cgit v1.2.3