diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-04 08:23:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-04 08:23:04 +0300 |
commit | c3e454b8e0808c8615cd58d86547e63642cde91d (patch) | |
tree | 77d20c732229c18dafd226d356814bd378258d0b /source/blender/bmesh/operators/bmo_extrude.c | |
parent | 0fe80121b9f073c6d9379f6a94cc0550704826e9 (diff) |
Fix T60099: Inconsistent normals from spin tool
Diffstat (limited to 'source/blender/bmesh/operators/bmo_extrude.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_extrude.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index 8c1624740da..a13024d8793 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -339,6 +339,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) BMOpSlot *slot_facemap_out; BMOpSlot *slot_edges_exclude; const bool use_normal_flip = BMO_slot_bool_get(op->slots_in, "use_normal_flip"); + const bool use_normal_from_adjacent = BMO_slot_bool_get(op->slots_in, "use_normal_from_adjacent"); /* initialize our sub-operators */ BMO_op_initf( @@ -489,13 +490,22 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) continue; } - /* orient loop to give same normal as a loop of newedge - * if it exists (will be an extruded face), - * else same normal as a loop of e, if it exists */ - const bool edge_normal_flip = !( - e_new->l ? - (e_new->l->v == e_new->v1) : - (!e->l || !(e->l->v == e->v1))); + bool edge_normal_flip; + if (use_normal_from_adjacent == false) { + /* Orient loop to give same normal as a loop of 'e_new' + * if it exists (will be one of the faces from the region), + * else same normal as a loop of e, if it exists. */ + edge_normal_flip = !( + e_new->l ? + (e_new->l->v == e_new->v1) : + (!e->l || !(e->l->v == e->v1))); + } + else { + /* Special case, needed for repetitive extrusions + * that use the normals from the previously created faces. */ + edge_normal_flip = !(e->l && e->v1 != e->l->v); + } + if (edge_normal_flip == use_normal_flip) { f_verts[0] = e->v1; f_verts[1] = e->v2; |