diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-09-28 21:55:05 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-09-28 22:00:54 +0400 |
commit | da78dd78be6c14e68dccd858708e5ad452fb4b75 (patch) | |
tree | f225d45110daa593d7498b8fe181e972c7212611 /source/blender/bmesh/operators/bmo_utils.c | |
parent | 653b67055b2dec321ef68114d5cace05113f9102 (diff) |
Fix T25582: Add a 'smooth factor' to smooth_vertex BMesh op.
Based on code by wahooney (Keith Boshoff), patch itself was merely rewritten due to BMesh changes...
Diffstat (limited to 'source/blender/bmesh/operators/bmo_utils.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index d2d1c0854de..1634aa25281 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -291,6 +291,7 @@ void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op) BMEdge *e; float (*cos)[3] = MEM_mallocN(sizeof(*cos) * BMO_slot_buffer_count(op->slots_in, "verts"), __func__); float *co, *co2, clip_dist = BMO_slot_float_get(op->slots_in, "clip_dist"); + float fac = BMO_slot_float_get(op->slots_in, "smooth_factor"); int i, j, clipx, clipy, clipz; int xaxis, yaxis, zaxis; @@ -322,7 +323,7 @@ void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op) } mul_v3_fl(co, 1.0f / (float)j); - mid_v3_v3v3(co, co, v->co); + interp_v3_v3v3(co, v->co, co, fac); if (clipx && fabsf(v->co[0]) <= clip_dist) co[0] = 0.0f; |