diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_bevel.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_bevel.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index f1dc73436ee..ba07a3a56cc 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -111,8 +111,8 @@ static void bevel_set_weighted_normal_face_strength(BMesh *bm, Scene *scene) } static void bevel_mod_harden_normals( - BevelModifierData *bmd, BMesh *bm, const float hn_strength, - const int hnmode, MDeformVert *dvert, int vgroup) + BevelModifierData *bmd, BMesh *bm, const float hn_strength, + const int hnmode, MDeformVert *dvert, int vgroup) { if (bmd->res > 20 || bmd->value == 0) return; @@ -136,7 +136,7 @@ static void bevel_mod_harden_normals( l_cur = l_first = BM_FACE_FIRST_LOOP(f); do { if ((!BM_elem_flag_test(l_cur->e, BM_ELEM_TAG)) || - (!BM_elem_flag_test(l_cur, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_cur))) + (!BM_elem_flag_test(l_cur, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_cur))) { /* previous and next edge is sharp, accumulate face normals into loop */ @@ -187,8 +187,9 @@ static void bevel_mod_harden_normals( } else if (bmd->lim_flags & MOD_BEVEL_VGROUP) { const bool has_vgroup = dvert != NULL; - const bool vert_of_group = has_vgroup && - (defvert_find_index(&dvert[BM_elem_index_get(l->v)], vgroup) != NULL); + const bool vert_of_group = ( + has_vgroup && + (defvert_find_index(&dvert[BM_elem_index_get(l->v)], vgroup) != NULL)); if (vert_of_group && hnmode == MOD_BEVEL_HN_FACE) { float cur[3]; @@ -223,20 +224,21 @@ static void bevel_mod_harden_normals( /* If vertex is edge vert with 1 reconnected face */ if (recon_face_count == 1 || do_normal_to_recon) { - BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], recon_face->no, - clnors); + BKE_lnor_space_custom_normal_to_data( + bm->lnor_spacearr->lspacearr[l_index], recon_face->no, clnors); } else if (vertex_only == false || recon_face_count == 0) { copy_v3_v3(n_final, l->f->no); mul_v3_fl(n_final, 1.0f - hn_strength); add_v3_v3(n_final, cn_wght); normalize_v3(n_final); - BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], n_final, - clnors); + BKE_lnor_space_custom_normal_to_data( + bm->lnor_spacearr->lspacearr[l_index], n_final, clnors); + } + else if (BLI_ghash_haskey(faceHash, l->f)) { + BKE_lnor_space_custom_normal_to_data( + bm->lnor_spacearr->lspacearr[l_index], l->v->no, clnors); } - else if (BLI_ghash_haskey(faceHash, l->f)) - BKE_lnor_space_custom_normal_to_data(bm->lnor_spacearr->lspacearr[l_index], l->v->no, - clnors); } } } @@ -466,7 +468,7 @@ ModifierTypeInfo modifierType_Bevel = { eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode | eModifierTypeFlag_AcceptsCVs, - + /* copyData */ modifier_copyData_generic, /* deformVerts_DM */ NULL, |