diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-27 13:24:00 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-27 13:24:00 +0400 |
commit | 6420dc23fd208840c99359b095d33eaef6223b82 (patch) | |
tree | 81e36a1f9774f7e33fb354037493eb296c53714e /source/blender/bmesh/operators/bmo_subdivide.c | |
parent | b37387d3b04bdee8a262378282b94c86988eece9 (diff) |
Fix bug 29123, subdivide smooth distorts shape with numcuts > 1.
Three fixes:
* When smoothing a coord, the original position should be based off
the unsmoothed subdivision (i.e. the vertex coord rather than the
smoothed position in the shapekey)
* The normal of new vertices created by edge split must be updated
(used the same interpolation as pre-bmesh here)
* The vertices created inside the subdivided face should use the
subdivided coords from edges, so copy the shapekey coords back to
vertex coords after subdividing edges
Diffstat (limited to 'source/blender/bmesh/operators/bmo_subdivide.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index f97f5225169..b0dd8778789 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -104,6 +104,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDPar BM_vert_normal_update_all(bm, v); co = CustomData_bmesh_get_n(&bm->vdata, v->head.data, CD_SHAPEKEY, params->origkey); + copy_v3_v3(co, v->co); copy_v3_v3(prev_co, co); if (params->beauty & B_SMOOTH) { @@ -205,6 +206,9 @@ static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge, } #endif + interp_v3_v3v3(ev->no, vsta->no, vend->no, percent2); + normalize_v3(ev->no); + return ev; } @@ -888,6 +892,12 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op) bm_subdivide_multicut(bmesh, edge, ¶ms, edge->v1, edge->v2); } + /* copy original-geometry displacements to current coordinate */ + BM_ITER(v, &viter, bmesh, BM_VERTS_OF_MESH, NULL) { + float *co = CustomData_bmesh_get_n(&bmesh->vdata, v->head.data, CD_SHAPEKEY, skey); + copy_v3_v3(v->co, co); + } + i = 0; for (i = 0; i < BLI_array_count(facedata); i++) { face = facedata[i].face; |