Fix #26039: Relative Shapkeys have wrong coordinates after inserting vertices
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 11 Feb 2011 17:56:25 +0000 (17:56 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 11 Feb 2011 17:56:25 +0000 (17:56 +0000)
There was invalid memory access for newly created vertices.
Added checking of keyindex value when calculating verticies offsets.

source/blender/editors/mesh/editmesh.c

index ed9f7edbd22aee25685f28f8a1c35964b692e40c..9376a21b23dc8ebd449d41f3cb30fd14d626d504 100644 (file)
@@ -1181,7 +1181,9 @@ void load_editMesh(Scene *scene, Object *obedit)
                                eve= em->verts.first;
                                mvert = me->mvert;
                                while(eve) {
-                                       VECSUB(ofs[i], mvert->co, oldverts[eve->keyindex].co);
+                                       if(eve->keyindex>=0)
+                                               VECSUB(ofs[i], mvert->co, oldverts[eve->keyindex].co);
+
                                        eve= eve->next;
                                        i++;
                                        mvert++;