Bugfix #27761
authorTon Roosendaal <ton@blender.org>
Sat, 9 Jul 2011 17:03:35 +0000 (17:03 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 9 Jul 2011 17:03:35 +0000 (17:03 +0000)
Material nodes: when no output node was active, it sets one.
Not common to happen anymore, only for deleting output nodes
without clicking on nodes.

source/blender/blenkernel/intern/node.c

index 518ee3c341a61234dbbafbc690daa883fda34375..13469e0b58bcb0a0c93cf942d8af9dd2ac04bf25 100644 (file)
@@ -2418,6 +2418,11 @@ void ntreeBeginExecTree(bNodeTree *ntree)
                
                if(ntree->type==NTREE_COMPOSIT)
                        composit_begin_exec(ntree, ntree->stack);
+               
+               /* ensures only a single output node is enabled, texnode allows multiple though */
+               if(ntree->type!=NTREE_TEXTURE)
+                       ntreeSetOutput(ntree);
+               
        }
        
        ntree->init |= NTREE_EXEC_INIT;
@@ -2765,9 +2770,6 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
        /* fixed seed, for example noise texture */
        BLI_srandom(rd->cfra);
 
-       /* ensures only a single output node is enabled */
-       ntreeSetOutput(ntree);
-
        /* sets need_exec tags in nodes */
        curnode = totnode= setExecutableNodes(ntree, &thdata);