diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2013-04-24 16:39:37 +0400 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2013-04-24 16:39:37 +0400 |
commit | d2daa230d61f4c35682c7345494ae41d1034a1b0 (patch) | |
tree | 794d0c06905596c7fc08b3465d0a3bf6866dc834 | |
parent | 245a175a003e88157a906fb444fa1f38918ada38 (diff) |
Fix bug #34611: bevel overlap limit
The previous fix limited overlap, but is sometimes
too conservative, and artists want way to turn off
the limiting, so added 'Allow Overlap' option to
modifier.
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_bmesh.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 5 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_bevel.c | 3 |
4 files changed, 13 insertions, 5 deletions
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,12 +119,12 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.prop(md, "end_cap") def BEVEL(self, layout, ob, md): - split = layout.split() + layout.prop(md, "width") + layout.prop(md, "segments") - split.prop(md, "width") + split = layout.split() split.prop(md, "use_only_vertices") - - layout.prop(md, "segments") + split.prop(md, "overlap_ok") layout.label(text="Limit Method:") layout.row().prop(md, "limit_method", expand=True) 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); |