Fix #29160: material node "Texture" didn't use default texture coordinates
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Nov 2011 14:13:43 +0000 (14:13 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Nov 2011 14:13:43 +0000 (14:13 +0000)
anymore when nothing was connected to the socket.

source/blender/nodes/shader/nodes/node_shader_texture.c

index dbf9fdbdb7e380047d3288711a14470b64c529ed..c26cf2451df481a9ebafc31d3f52befa1eb30b3b 100644 (file)
@@ -51,6 +51,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
        if(data && node->id) {
                ShadeInput *shi= ((ShaderCallData *)data)->shi;
                TexResult texres;
+               bNodeSocket *sock_vector= node->inputs.first;
                float vec[3], nor[3]={0.0f, 0.0f, 0.0f};
                int retval;
                short which_output = node->custom1;
@@ -63,7 +64,8 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
                texres.nor= nor;
                texres.tr= texres.tg= texres.tb= 0.0f;
                
-               if(in[0]->hasinput) {
+               /* don't use in[0]->hasinput, see material node for explanation */
+               if(sock_vector->link) {
                        nodestack_get_vec(vec, SOCK_VECTOR, in[0]);
                        
                        if(in[0]->datatype==NS_OSA_VECTORS) {