Fix #29160: material node "Texture" didn't use default texture coordinates

anymore when nothing was connected to the socket.
This commit is contained in:
Brecht Van Lommel 2011-11-16 14:13:43 +00:00
parent ed5815fc7f
commit 004cb6ba1b

@ -51,6 +51,7 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
if(data && node->id) { if(data && node->id) {
ShadeInput *shi= ((ShaderCallData *)data)->shi; ShadeInput *shi= ((ShaderCallData *)data)->shi;
TexResult texres; TexResult texres;
bNodeSocket *sock_vector= node->inputs.first;
float vec[3], nor[3]={0.0f, 0.0f, 0.0f}; float vec[3], nor[3]={0.0f, 0.0f, 0.0f};
int retval; int retval;
short which_output = node->custom1; 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.nor= nor;
texres.tr= texres.tg= texres.tb= 0.0f; 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]); nodestack_get_vec(vec, SOCK_VECTOR, in[0]);
if(in[0]->datatype==NS_OSA_VECTORS) { if(in[0]->datatype==NS_OSA_VECTORS) {