BI: fix counting of tangents, that was reset during recursion of init_render_nodetree
authorAlexander Romanov <a.romanov@blend4web.com>
Wed, 1 Jun 2016 09:28:48 +0000 (12:28 +0300)
committerAlexander Romanov <a.romanov@blend4web.com>
Wed, 1 Jun 2016 09:28:48 +0000 (12:28 +0300)
source/blender/blenkernel/intern/material.c

index 1fec725dbb7c6177f02e3dcde0bda89c831b2934..30f82a50ed96e1ac040793a16f3fc1593df11ba6 100644 (file)
@@ -1148,7 +1148,6 @@ static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode
 
        /* parses the geom+tex nodes */
        ntreeShaderGetTexcoMode(ntree, r_mode, &basemat->texco, &basemat->mode_l);
-       basemat->nmap_tangent_names_count = 0;
        for (node = ntree->nodes.first; node; node = node->next) {
                if (node->id) {
                        if (GS(node->id->name) == ID_MA) {
@@ -1199,7 +1198,7 @@ void init_render_material(Material *mat, int r_mode, float *amb)
                 * mode_l will have it set when all node materials are shadeless. */
                mat->mode_l = (mat->mode & MA_MODE_PIPELINE) | MA_SHLESS;
                mat->mode2_l = mat->mode2 & MA_MODE2_PIPELINE;
-
+               mat->nmap_tangent_names_count = 0;
                init_render_nodetree(mat->nodetree, mat, r_mode, amb);
                
                if (!mat->nodetree->execdata)