normals were updated incorrectly in buffers when sculpting. Still not perfect.
authorLukas Steiblys <imbusy@imbusy.org>
Mon, 5 Oct 2009 09:03:35 +0000 (09:03 +0000)
committerLukas Steiblys <imbusy@imbusy.org>
Mon, 5 Oct 2009 09:03:35 +0000 (09:03 +0000)
source/blender/editors/sculpt_paint/sculpt.c

index 470a10b5e50282fb3ba9c2f4a6f5c3c9cdabc79f..01a2ff3fdee8b279d6986c46920d00c0515e1342 100644 (file)
@@ -1014,9 +1014,9 @@ static void update_damaged_vert(SculptSession *ss, ListBase *lb)
                                                CalcNormFloat4(ss->mvert[ss->mface[i].v1].co, ss->mvert[ss->mface[i].v2].co, ss->mvert[ss->mface[i].v3].co, ss->mvert[ss->mface[i].v4].co, norm);
                                        else
                                                CalcNormFloat(ss->mvert[ss->mface[i].v1].co, ss->mvert[ss->mface[i].v2].co, ss->mvert[ss->mface[i].v3].co, norm);
-                                       VECCOPY(&buffer[cur->element*3],norm);
-                                       VECCOPY(&buffer[cur->element*3],norm);
-                                       VECCOPY(&buffer[cur->element*3],norm);
+                                       VECCOPY(&buffer[(cur->element-cur->element%3)*3],norm);
+                                       VECCOPY(&buffer[(cur->element-cur->element%3+1)*3],norm);
+                                       VECCOPY(&buffer[(cur->element-cur->element%3+2)*3],norm);
                                }
 
                                //VECCOPY(&buffer[cur->element*3],ss->mvert[vert->Index].no);