shape key mirror failed with center verts
authorCampbell Barton <ideasman42@gmail.com>
Fri, 16 Oct 2009 16:09:57 +0000 (16:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 16 Oct 2009 16:09:57 +0000 (16:09 +0000)
source/blender/editors/object/object_shapekey.c

index 442b86abd9894453c8a50e0bffea63696b2e33c1..61ea9ab44a0e7a579fbd1488a6b828fbb57d892f 100644 (file)
@@ -507,7 +507,12 @@ static int ED_object_shape_key_mirror(bContext *C, Scene *scene, Object *ob)
 
                        for(i1=0, mv=me->mvert; i1<me->totvert; i1++, mv++) {
                                i2= mesh_get_x_mirror_vert(ob, i1);
-                               if(i2 != -1) {
+                               if(i2==i1) {
+                                       fp1= ((float *)kb->data) + i1*3;
+                                       fp1[0] = -fp1[0];
+                                       tag_elem[i1]= 1;
+                               }
+                               else if(i2 != -1) {
                                        if(tag_elem[i1]==0 && tag_elem[i2]==0) {
                                                fp1= ((float *)kb->data) + i1*3;
                                                fp2= ((float *)kb->data) + i2*3;
@@ -522,7 +527,6 @@ static int ED_object_shape_key_mirror(bContext *C, Scene *scene, Object *ob)
                                        }
                                        tag_elem[i1]= tag_elem[i2]= 1;
                                }
-
                        }
 
                        mesh_octree_table(ob, NULL, NULL, 'e');