[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52810] trunk/blender/source/blender/bmesh /tools/bmesh_bevel.c: Bevel: fix 'causing artifacts' bug 33245.

Howard Trickey howard.trickey at gmail.com
Fri Dec 7 19:45:52 CET 2012


Revision: 52810
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52810
Author:   howardt
Date:     2012-12-07 18:45:52 +0000 (Fri, 07 Dec 2012)
Log Message:
-----------
Bevel: fix 'causing artifacts' bug 33245.
Really was caused by a previous bevel making
a two-edged face, which caused other faces to
be dropped when copying a bmesh.
The quadstrip code needed to be more careful
to avoid creating two-edge faces.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c

Modified: trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c
===================================================================
--- trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c	2012-12-07 16:35:43 UTC (rev 52809)
+++ trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c	2012-12-07 18:45:52 UTC (rev 52810)
@@ -1295,39 +1295,27 @@
 		EdgeHalf *eh_b = next_bev(bv, eh_a->next);  /* since (selcount == 2) we know this is valid */
 		BMLoop *l_a = BM_face_vert_share_loop(f, eh_a->rightv->nv.v);
 		BMLoop *l_b = BM_face_vert_share_loop(f, eh_b->leftv->nv.v);
-		int seg_count = bv->vmesh->seg;  /* ensure we don't walk past the segments */
+		int split_count = bv->vmesh->seg + 1;  /* ensure we don't walk past the segments */
 
-		if (l_a == l_b) {
-			/* step once around if we hit the same loop */
-			l_a = l_a->prev;
-			l_b = l_b->next;
-			seg_count--;
-		}
-
-		BLI_assert(l_a != l_b);
-
-		while (f->len > 4) {
+		while (f->len > 4 && split_count > 0) {
 			BMLoop *l_new;
 			BLI_assert(l_a->f == f);
 			BLI_assert(l_b->f == f);
 
-			BM_face_split(bm, f, l_a->v, l_b->v, &l_new, NULL, FALSE);
-			if (seg_count-- == 0) {
-				break;
+			if (l_a-> v == l_b->v || l_a->next == l_b) {
+				/* l_a->v and l_b->v can be the same or such that we'd make a 2-vertex poly */
+				l_a = l_a->prev;
+				l_b = l_b->next;
 			}
+			else {
+				BM_face_split(bm, f, l_a->v, l_b->v, &l_new, NULL, FALSE);
+				f = l_new->f;
 
-			/* turns out we don't need this,
-			 * because of how BM_face_split works we always get the loop of the next face */
-#if 0
-			if (l_new->f->len < l_new->radial_next->f->len) {
-				l_new = l_new->radial_next;
+				/* walk around the new face to get the next verts to split */
+				l_a = l_new->prev;
+				l_b = l_new->next->next;
 			}
-#endif
-			f = l_new->f;
-
-			/* walk around the new face to get the next verts to split */
-			l_a = l_new->prev;
-			l_b = l_new->next->next;
+			split_count--;
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list