diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_bevel.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_bevel.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 2de3220e683..5874029ae08 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -112,6 +112,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, const bool do_clamp = !(bmd->flags & MOD_BEVEL_OVERLAP_OK); const int offset_type = bmd->val_flags; const int mat = CLAMPIS(bmd->mat, -1, ob->totcol - 1); + const bool loop_slide = (bmd->flags & MOD_BEVEL_EVEN_WIDTHS) == 0; bm = DM_to_bmesh(dm, true); if ((bmd->lim_flags & MOD_BEVEL_VGROUP) && bmd->defgrp_name[0]) @@ -121,7 +122,12 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if (!BM_vert_is_manifold(v)) continue; - if (vgroup != -1) { + if (bmd->lim_flags & MOD_BEVEL_WEIGHT) { + weight = BM_elem_float_data_get(&bm->vdata, v, CD_BWEIGHT); + if (weight == 0.0f) + continue; + } + else if (vgroup != -1) { weight = defvert_array_find_weight_safe(dvert, BM_elem_index_get(v), vgroup); /* Check is against 0.5 rather than != 0.0 because cascaded bevel modifiers will * interpolate weights for newly created vertices, and may cause unexpected "selection" */ @@ -168,7 +174,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, BM_mesh_bevel(bm, bmd->value, offset_type, bmd->res, bmd->profile, vertex_only, bmd->lim_flags & MOD_BEVEL_WEIGHT, do_clamp, - dvert, vgroup, mat); + dvert, vgroup, mat, loop_slide); result = CDDM_from_bmesh(bm, true); @@ -208,6 +214,7 @@ ModifierTypeInfo modifierType_Bevel = { /* freeData */ NULL, /* isDisabled */ NULL, /* updateDepgraph */ NULL, + /* updateDepsgraph */ NULL, /* dependsOnTime */ NULL, /* dependsOnNormals */ dependsOnNormals, /* foreachObjectLink */ NULL, |