[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56259] trunk/blender: Fix bug #34611: bevel overlap limit

Howard Trickey howard.trickey at gmail.com
Wed Apr 24 14:39:37 CEST 2013


Revision: 56259
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56259
Author:   howardt
Date:     2013-04-24 12:39:37 +0000 (Wed, 24 Apr 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
    trunk/blender/source/blender/blenkernel/BKE_bmesh.h
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c
    trunk/blender/source/blender/modifiers/intern/MOD_bevel.c

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2013-04-24 12:07:13 UTC (rev 56258)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2013-04-24 12:39:37 UTC (rev 56259)
@@ -119,13 +119,13 @@
         layout.prop(md, "end_cap")
 
     def BEVEL(self, layout, ob, md):
+        layout.prop(md, "width")
+        layout.prop(md, "segments")
+
         split = layout.split()
-
-        split.prop(md, "width")
         split.prop(md, "use_only_vertices")
+        split.prop(md, "overlap_ok")
 
-        layout.prop(md, "segments")
-
         layout.label(text="Limit Method:")
         layout.row().prop(md, "limit_method", expand=True)
         if md.limit_method == 'ANGLE':

Modified: trunk/blender/source/blender/blenkernel/BKE_bmesh.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_bmesh.h	2013-04-24 12:07:13 UTC (rev 56258)
+++ trunk/blender/source/blender/blenkernel/BKE_bmesh.h	2013-04-24 12:39:37 UTC (rev 56259)
@@ -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 */

Modified: trunk/blender/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2013-04-24 12:07:13 UTC (rev 56258)
+++ trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2013-04-24 12:39:37 UTC (rev 56259)
@@ -2364,6 +2364,11 @@
 	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
 
 }

Modified: trunk/blender/source/blender/modifiers/intern/MOD_bevel.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_bevel.c	2013-04-24 12:07:13 UTC (rev 56258)
+++ trunk/blender/source/blender/modifiers/intern/MOD_bevel.c	2013-04-24 12:39:37 UTC (rev 56259)
@@ -111,6 +111,7 @@
 	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 @@
 	}
 
 	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);




More information about the Bf-blender-cvs mailing list