[Bf-blender-cvs] [7f682dd] master: Fix T49226: Incorrect Material viewport shading of Cycles Normal Map node in Edit mode for an object with Array modifier

Sergey Sharybin noreply at git.blender.org
Mon Sep 5 10:21:06 CEST 2016


Commit: 7f682dd7040e1abacf591b00bfb03fc590493e54
Author: Sergey Sharybin
Date:   Fri Sep 2 17:50:30 2016 +0200
Branches: master
https://developer.blender.org/rB7f682dd7040e1abacf591b00bfb03fc590493e54

Fix T49226: Incorrect Material viewport shading of Cycles Normal Map node in Edit mode for an object with Array modifier

Was incorrect indexing done in the array. Caused by 5abae51.

Not sure why it needed to be changed here, but array here is supposed to be
a loop data, so bringing back loop index as it originally was. The shading was
wrong in edit mode with BI active as well (so it's not like it's needed for
BI only).

Patch in collaboration with Alexander Gavrilov (angavrilov), thanks!

Should be double-checked and ported to 2.78.

===================================================================

M	source/blender/blenkernel/intern/DerivedMesh.c

===================================================================

diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 293309c..ad3c4f8 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -3836,7 +3836,7 @@ void DM_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int index, int vert,
 	for (b = 0; b < attribs->tottang; b++) {
 		if (attribs->tang[b].array) {
 			/*const*/ float (*array)[4] = attribs->tang[b].array;
-			const float *tang = (array) ? array[a * 4 + vert] : zero;
+			const float *tang = (array) ? array[loop] : zero;
 			glVertexAttrib4fv(attribs->tang[b].gl_index, tang);
 		}
 	}




More information about the Bf-blender-cvs mailing list