diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-27 21:35:02 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-27 21:35:02 +0400 |
commit | 718569dc16e35ef37838d0357f75e945a96928b1 (patch) | |
tree | f04df90266a07cbeaca7a48df4d2541d6ddd28aa /source/blender/bmesh | |
parent | 990466e87eee76e9e846694c977691fb43e427d1 (diff) |
Fix #32199: Smooth Vertex no longer has X, Y and Z options.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 3 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index c80a88d280e..eacee8e12ad 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -104,6 +104,9 @@ static BMOpDefine bmo_smooth_vert_def = { {BMO_OP_SLOT_BOOL, "mirror_clip_y"}, /* set vertices close to the y axis before the operation to 0 */ {BMO_OP_SLOT_BOOL, "mirror_clip_z"}, /* set vertices close to the z axis before the operation to 0 */ {BMO_OP_SLOT_FLT, "clipdist"}, /* clipping threshod for the above three slots */ + {BMO_OP_SLOT_BOOL, "use_axis_x"}, /* smooth vertices along X axis */ + {BMO_OP_SLOT_BOOL, "use_axis_y"}, /* smooth vertices along Y axis */ + {BMO_OP_SLOT_BOOL, "use_axis_z"}, /* smooth vertices along Z axis */ {0} /* null-terminating sentinel */, }, bmo_smooth_vert_exec, diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index 5664c487236..6d5d74ebed1 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -413,11 +413,16 @@ void bmo_smooth_vert_exec(BMesh *bm, BMOperator *op) float (*cos)[3] = NULL; float *co, *co2, clipdist = BMO_slot_float_get(op, "clipdist"); int i, j, clipx, clipy, clipz; + int xaxis, yaxis, zaxis; clipx = BMO_slot_bool_get(op, "mirror_clip_x"); clipy = BMO_slot_bool_get(op, "mirror_clip_y"); clipz = BMO_slot_bool_get(op, "mirror_clip_z"); + xaxis = BMO_slot_bool_get(op, "use_axis_x"); + yaxis = BMO_slot_bool_get(op, "use_axis_y"); + zaxis = BMO_slot_bool_get(op, "use_axis_z"); + i = 0; BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) { BLI_array_grow_one(cos); @@ -451,7 +456,13 @@ void bmo_smooth_vert_exec(BMesh *bm, BMOperator *op) i = 0; BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) { - copy_v3_v3(v->co, cos[i]); + if (xaxis) + v->co[0] = cos[i][0]; + if (yaxis) + v->co[1] = cos[i][1]; + if (zaxis) + v->co[2] = cos[i][2]; + i++; } |