From e25b59923b337dee7dae1ef77d171fc71e880d02 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Feb 2012 15:25:12 +0000 Subject: [PATCH] fix for smooth not working with mirror clip. --- source/blender/bmesh/operators/utils.c | 6 +++--- source/blender/editors/mesh/bmesh_tools.c | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/blender/bmesh/operators/utils.c b/source/blender/bmesh/operators/utils.c index 4ba7ed96324..50b97ba4461 100644 --- a/source/blender/bmesh/operators/utils.c +++ b/source/blender/bmesh/operators/utils.c @@ -421,11 +421,11 @@ void bmesh_vertexsmooth_exec(BMesh *bm, BMOperator *op) mul_v3_fl(co, 1.0f / (float)j); mid_v3_v3v3(co, co, v->co); - if (clipx && fabsf(v->co[0]) < clipdist) + if (clipx && fabsf(v->co[0]) <= clipdist) co[0] = 0.0f; - if (clipy && fabsf(v->co[1]) < clipdist) + if (clipy && fabsf(v->co[1]) <= clipdist) co[1] = 0.0f; - if (clipz && fabsf(v->co[2]) < clipdist) + if (clipz && fabsf(v->co[2]) <= clipdist) co[2] = 0.0f; i++; diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index c31d24a2d8b..1e268cd58fd 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -1608,6 +1608,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op) ModifierData *md; int mirrx=0, mirry=0, mirrz=0; int i, repeat; + float clipdist = 0.0f; /* mirror before smooth */ if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) { @@ -1628,6 +1629,8 @@ static int do_smooth_vertex(bContext *C, wmOperator *op) mirry = 1; if (mmd->flag & MOD_MIR_AXIS_Z) mirrz = 1; + + clipdist = mmd->tolerance; } } } @@ -1637,8 +1640,9 @@ static int do_smooth_vertex(bContext *C, wmOperator *op) repeat = 1; for (i=0; i