fix for smooth not working with mirror clip.

This commit is contained in:
Campbell Barton
2012-02-10 15:25:12 +00:00
parent 838abe1a8b
commit e25b59923b
2 changed files with 9 additions and 5 deletions

View File

@@ -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++;

View File

@@ -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<repeat; i++) {
if (!EDBM_CallOpf(em, op, "vertexsmooth verts=%hv mirror_clip_x=%d mirror_clip_y=%d mirror_clip_z=%d",
BM_SELECT, mirrx, mirry, mirrz))
if (!EDBM_CallOpf(em, op,
"vertexsmooth verts=%hv mirror_clip_x=%d mirror_clip_y=%d mirror_clip_z=%d clipdist=%f",
BM_SELECT, mirrx, mirry, mirrz, clipdist))
{
return OPERATOR_CANCELLED;
}