* corrective UV transformation - only works with UV edge slide right now. but should...
[blender.git] / source / blender / src / editmesh_mods.c
index c162c904776638bf8270cf49cfcbfac0241a01cd..81d0ffeeb3bc4424214e3bb413b81e88828a3d8d 100644 (file)
@@ -4202,7 +4202,7 @@ void editmesh_align_view_to_selected(View3D *v3d, int axis)
 void vertexsmooth(void)
 {
        EditMesh *em = G.editMesh;
-       EditVert *eve;
+       EditVert *eve, *eve_mir = NULL;
        EditEdge *eed;
        float *adror, *adr, fac;
        float fvec[3];
@@ -4285,13 +4285,19 @@ void vertexsmooth(void)
        while(eve) {
                if(eve->f & SELECT) {
                        if(eve->f1) {
+                               
+                               if (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR) {
+                                       eve_mir= editmesh_get_x_mirror_vert(G.obedit, eve->co);
+                               }
+                               
                                adr = eve->tmp.p;
                                fac= 0.5/(float)eve->f1;
                                
                                eve->co[0]= 0.5*eve->co[0]+fac*adr[0];
                                eve->co[1]= 0.5*eve->co[1]+fac*adr[1];
                                eve->co[2]= 0.5*eve->co[2]+fac*adr[2];
-
+                               
+                               
                                /* clip if needed by mirror modifier */
                                if (eve->f2) {
                                        if (eve->f2 & 1) {
@@ -4304,6 +4310,13 @@ void vertexsmooth(void)
                                                eve->co[2]= 0.0f;
                                        }
                                }
+                               
+                               if (eve_mir) {
+                                       eve_mir->co[0]=-eve->co[0];
+                                       eve_mir->co[1]= eve->co[1];
+                                       eve_mir->co[2]= eve->co[2];
+                               }
+                               
                        }
                        eve->tmp.p= NULL;
                }