[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55865] trunk/blender/source/blender/bmesh /operators/bmo_inset.c: simplify inset loop-customdata-copying, no real benefit in using adjacent faces as customdata source.

Campbell Barton ideasman42 at gmail.com
Sun Apr 7 05:24:33 CEST 2013


Revision: 55865
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55865
Author:   campbellbarton
Date:     2013-04-07 03:24:30 +0000 (Sun, 07 Apr 2013)
Log Message:
-----------
simplify inset loop-customdata-copying, no real benefit in using adjacent faces as customdata source.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/operators/bmo_inset.c

Modified: trunk/blender/source/blender/bmesh/operators/bmo_inset.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_inset.c	2013-04-07 02:10:15 UTC (rev 55864)
+++ trunk/blender/source/blender/bmesh/operators/bmo_inset.c	2013-04-07 03:24:30 UTC (rev 55865)
@@ -170,12 +170,8 @@
 		do {
 			BMFace *f_new_outer;
 
-			BMLoop *l_iter_sub;
-			BMLoop *l_a = NULL;
-			BMLoop *l_b = NULL;
-			BMLoop *l_a_other = NULL;
-			BMLoop *l_b_other = NULL;
-			BMLoop *l_shared = NULL;
+			BMLoop *l_a;
+			BMLoop *l_b;
 
 			BM_elem_attrs_copy(bm, bm, l_iter, l_iter_inner);
 
@@ -196,30 +192,11 @@
 			l_a = BM_FACE_FIRST_LOOP(f_new_outer);
 			l_b = l_a->next;
 
-			l_iter_sub = l_iter;
+			/* first pair */
+			BM_elem_attrs_copy(bm, bm, l_iter, l_a);
+			BM_elem_attrs_copy(bm, bm,  l_iter->next, l_b);
 
-			/* Skip old face f and new inset face.
-			 * If loop if found we are a boundary. This
-			 * is required as opposed to BM_edge_is_boundary()
-			 * Because f_new_outer shares an edge with f */
-			do {
-				if (l_iter_sub->f != f && l_iter_sub->f != f_new_outer) {
-					l_shared = l_iter_sub;
-					break;
-				}
-			} while ((l_iter_sub = l_iter_sub->radial_next) != l_iter);
 
-			if (l_shared) {
-				BM_elem_attrs_copy(bm, bm, l_shared, l_a->next);
-				BM_elem_attrs_copy(bm, bm, l_shared->next, l_a);
-			}
-			else {
-				l_a_other = BM_edge_other_loop(l_a->e, l_a);
-				l_b_other = l_a_other->next;
-				BM_elem_attrs_copy(bm, bm, l_a_other, l_a);
-				BM_elem_attrs_copy(bm, bm, l_b_other, l_b);
-			}
-
 			/* Move to the last two loops in new face */
 			l_a = l_b->next;
 			l_b = l_a->next;
@@ -715,18 +692,10 @@
 			/* step around to the opposite side of the quad - warning, this may have no other edges! */
 			l_a = l_a->next->next;
 			l_b = l_a->next;
-			if (!BM_edge_is_boundary(l_a->e)) {
-				/* same as above */
-				l_a_other = BM_edge_other_loop(l_a->e, l_a);
-				l_b_other = BM_edge_other_loop(l_a->e, l_b);
-				BM_elem_attrs_copy(bm, bm, l_a_other, l_a);
-				BM_elem_attrs_copy(bm, bm, l_b_other, l_b);
-			}
-			else {  /* boundary edges have no useful data to copy from, use opposite side of face */
-				/* swap a<->b intentionally */
-				BM_elem_attrs_copy(bm, bm, l_a_other, l_b);
-				BM_elem_attrs_copy(bm, bm, l_b_other, l_a);
-			}
+
+			/* swap a<->b intentionally */
+			BM_elem_attrs_copy(bm, bm, l_a_other, l_b);
+			BM_elem_attrs_copy(bm, bm, l_b_other, l_a);
 		}
 #endif
 	}




More information about the Bf-blender-cvs mailing list