diff options
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_edgesplit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index f52632cdcc9..8db8da3fc81 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -58,8 +58,10 @@ static Mesh *doEdgeSplit(Mesh *mesh, EdgeSplitModifierData *emd, const ModifierE BMesh *bm; BMIter iter; BMEdge *e; - float threshold = cosf(emd->split_angle + 0.000000175f); - const bool calc_face_normals = (emd->flags & MOD_EDGESPLIT_FROMANGLE) != 0; + const float threshold = cosf(emd->split_angle + 0.000000175f); + const bool do_split_angle = (emd->flags & MOD_EDGESPLIT_FROMANGLE) != 0 && emd->split_angle < (float)M_PI; + const bool do_split_all = do_split_angle && emd->split_angle < FLT_EPSILON; + const bool calc_face_normals = do_split_angle && !do_split_all; bm = BKE_mesh_to_bmesh_ex( mesh, @@ -72,7 +74,7 @@ static Mesh *doEdgeSplit(Mesh *mesh, EdgeSplitModifierData *emd, const ModifierE .cd_mask_extra = CD_MASK_ORIGINDEX, }); - if (emd->flags & MOD_EDGESPLIT_FROMANGLE) { + if (do_split_angle) { BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { /* check for 1 edge having 2 face users */ BMLoop *l1, *l2; @@ -81,6 +83,8 @@ static Mesh *doEdgeSplit(Mesh *mesh, EdgeSplitModifierData *emd, const ModifierE { if (/* 3+ faces on this edge, always split */ UNLIKELY(l1 != l2->radial_next) || + /* O° angle setting, we want to split on all edges. */ + do_split_all || /* 2 face edge - check angle*/ (dot_v3v3(l1->f->no, l2->f->no) < threshold)) { |