diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index a99919f68ad..85447d4f183 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -119,13 +119,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.prop(md, "end_cap") def BEVEL(self, layout, ob, md): - split = layout.split() - - split.prop(md, "width") - split.prop(md, "use_only_vertices") - + layout.prop(md, "width") layout.prop(md, "segments") + split = layout.split() + split.prop(md, "use_only_vertices") + split.prop(md, "overlap_ok") + layout.label(text="Limit Method:") layout.row().prop(md, "limit_method", expand=True) if md.limit_method == 'ANGLE': diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h index 4bc21625cf3..7bd131ed704 100644 --- a/source/blender/blenkernel/BKE_bmesh.h +++ b/source/blender/blenkernel/BKE_bmesh.h @@ -66,6 +66,8 @@ * here because they are mixed - campbell */ #define BME_BEVEL_DIST (1 << 12) /* same as above */ +#define BME_BEVEL_OVERLAP_OK (1 << 13) + typedef struct BME_TransData { struct BMesh *bm; /* the bmesh the vert belongs to */ struct BMVert *v; /* pointer to the vert this tdata applies to */ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index d84c3fa039f..4b5e08065d6 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2364,6 +2364,11 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_BevelModifier_defgrp_name_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "overlap_ok", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_OVERLAP_OK); + RNA_def_property_ui_text(prop, "Allow Overlap", "Do not clamp the width to avoid overlap"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); #endif } diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index b14c4ba0ad1..2d7a7b36a8f 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -111,6 +111,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, BevelModifierData *bmd = (BevelModifierData *) md; const float threshold = cosf((bmd->bevel_angle + 0.00001f) * (float)M_PI / 180.0f); const bool vertex_only = bmd->flags & BME_BEVEL_VERT; + const bool do_clamp = !(bmd->flags & BME_BEVEL_OVERLAP_OK); bm = DM_to_bmesh(dm); @@ -160,7 +161,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob, } BM_mesh_bevel(bm, bmd->value, bmd->res, - vertex_only, bmd->lim_flags & BME_BEVEL_WEIGHT, true, + vertex_only, bmd->lim_flags & BME_BEVEL_WEIGHT, do_clamp, dvert, vgroup); result = CDDM_from_bmesh(bm, TRUE);