diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-22 12:38:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-22 12:41:07 +0400 |
commit | 728041019e8ee30a939a521c251d60e1f996a313 (patch) | |
tree | f8defb3238ef443c694faf34d4ca2a2d9475c61b /source/blender/bmesh/operators/bmo_extrude.c | |
parent | 7bc2f54867db5c56fc6934d09355836a17669cf3 (diff) |
Editmesh: extruding end-point verts now maintains edge-direction
Resolves T40745, where faces from extruded edges had flipped normals.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_extrude.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_extrude.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index f924d478f1a..d1747691c90 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -212,13 +212,20 @@ void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op) for (v = BMO_iter_new(&siter, op->slots_in, "verts", BM_VERT); v; v = BMO_iter_step(&siter)) { dupev = BM_vert_create(bm, v->co, v, BM_CREATE_NOP); + BMO_elem_flag_enable(bm, dupev, EXT_KEEP); + if (has_vskin) bm_extrude_disable_skin_root(bm, v); - e = BM_edge_create(bm, v, dupev, NULL, BM_CREATE_NOP); + /* not essentuial, but ensures face normals from extruded edges are contiguous */ + if (BM_vert_is_wire_endpoint(v)) { + if (v->e->v1 == v) { + SWAP(BMVert *, v, dupev); + } + } + e = BM_edge_create(bm, v, dupev, NULL, BM_CREATE_NOP); BMO_elem_flag_enable(bm, e, EXT_KEEP); - BMO_elem_flag_enable(bm, dupev, EXT_KEEP); } BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "verts.out", BM_VERT, EXT_KEEP); |