Fix crash in texture nodes, when no derivatives available, other nodes already
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 31 Oct 2011 16:44:24 +0000 (16:44 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 31 Oct 2011 16:44:24 +0000 (16:44 +0000)
did this check.

source/blender/nodes/texture/nodes/node_texture_texture.c

index 2d54347..1b8eb3a 100644 (file)
@@ -54,8 +54,14 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
        float co[3], dxt[3], dyt[3];
        
        copy_v3_v3(co, p->co);
-       copy_v3_v3(dxt, p->dxt);
-       copy_v3_v3(dyt, p->dyt);
+       if (p->osatex) {
+               copy_v3_v3(dxt, p->dxt);
+               copy_v3_v3(dyt, p->dyt);
+       }
+       else {
+               zero_v3(dxt);
+               zero_v3(dyt);
+       }
        
        if(node->custom2 || node->need_exec==0) {
                /* this node refers to its own texture tree! */