[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59884] branches/soc-2013-rigid_body_sim: svn merge -r59227:59228 ^/trunk/blender

Sergej Reich sergej.reich at googlemail.com
Fri Sep 6 19:45:59 CEST 2013


Revision: 59884
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59884
Author:   sergof
Date:     2013-09-06 17:45:58 +0000 (Fri, 06 Sep 2013)
Log Message:
-----------
svn merge -r59227:59228 ^/trunk/blender

Missed this in last merge.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59227

Modified Paths:
--------------
    branches/soc-2013-rigid_body_sim/source/blender/bmesh/bmesh_class.h
    branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.c
    branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.h
    branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_queries.h
    branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_hull.c
    branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_inset.c

Property Changed:
----------------
    branches/soc-2013-rigid_body_sim/


Property changes on: branches/soc-2013-rigid_body_sim
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-depsgraph_mt:57516,57900,57939-57940,57945,57958-57961,58151,58155-58156,58169,58277-58279,58282-58283,58711,58787,58789,58796,59086-59087,59163,59166,59170,59181,59259-59260
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-57521,57525-57642,57644-57984,57986-57990,57992-58488,58495-59227,59230-59868
   + /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-depsgraph_mt:57516,57900,57939-57940,57945,57958-57961,58151,58155-58156,58169,58277-58279,58282-58283,58711,58787,58789,58796,59086-59087,59163,59166,59170,59181,59259-59260
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-57521,57525-57642,57644-57984,57986-57990,57992-58488,58495-59228,59230-59868

Modified: branches/soc-2013-rigid_body_sim/source/blender/bmesh/bmesh_class.h
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/bmesh/bmesh_class.h	2013-09-06 16:07:49 UTC (rev 59883)
+++ branches/soc-2013-rigid_body_sim/source/blender/bmesh/bmesh_class.h	2013-09-06 17:45:58 UTC (rev 59884)
@@ -254,6 +254,8 @@
 struct BPy_BMGeneric;
 extern void bpy_bm_generic_invalidate(struct BPy_BMGeneric *self);
 
+typedef bool (*BMElemFilterFunc)(BMElem *, void *user_data);
+
 /* defines */
 #define BM_ELEM_CD_GET_VOID_P(ele, offset) \
 	(assert(offset != -1), (void *)((char *)(ele)->head.data + (offset)))

Modified: branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.c
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.c	2013-09-06 16:07:49 UTC (rev 59883)
+++ branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.c	2013-09-06 17:45:58 UTC (rev 59884)
@@ -74,33 +74,61 @@
 
 /**
  * \brief copies face loop data from shared adjacent faces.
+ *
+ * \param filter_fn  A function that filters the source loops before copying (don't always want to copy all)
+ *
  * \note when a matching edge is found, both loops of that edge are copied
  * this is done since the face may not be completely surrounded by faces,
- * this way: a quad with 2 connected quads on either side will still get all 4 loops updated */
-void BM_face_copy_shared(BMesh *bm, BMFace *f)
+ * this way: a quad with 2 connected quads on either side will still get all 4 loops updated
+ */
+void BM_face_copy_shared(BMesh *bm, BMFace *f,
+                         BMElemFilterFunc filter_fn, void *user_data)
 {
 	BMLoop *l_first;
 	BMLoop *l_iter;
 
+#ifdef DEBUG
 	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
 	do {
+		BLI_assert(BM_ELEM_API_FLAG_TEST(l_iter, _FLAG_OVERLAP) == 0);
+	} while ((l_iter = l_iter->next) != l_first);
+#endif
+
+	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+	do {
 		BMLoop *l_other = l_iter->radial_next;
 
 		if (l_other && l_other != l_iter) {
+			BMLoop *l_src[2];
+			BMLoop *l_dst[2] = {l_iter, l_iter->next};
+			unsigned int j;
+
 			if (l_other->v == l_iter->v) {
-				bm_loop_attrs_copy(bm, bm, l_other, l_iter);
-				bm_loop_attrs_copy(bm, bm, l_other->next, l_iter->next);
+				l_src[0] = l_other;
+				l_src[1] = l_other->next;
 			}
 			else {
-				bm_loop_attrs_copy(bm, bm, l_other->next, l_iter);
-				bm_loop_attrs_copy(bm, bm, l_other, l_iter->next);
+				l_src[0] = l_other->next;
+				l_src[1] = l_other;
 			}
-			/* since we copy both loops of the shared edge, step over the next loop here */
-			if ((l_iter = l_iter->next) == l_first) {
-				break;
+
+			for (j = 0; j < 2; j++) {
+				BLI_assert(l_dst[j]->v == l_src[j]->v);
+				if (BM_ELEM_API_FLAG_TEST(l_dst[j], _FLAG_OVERLAP) == 0) {
+					if ((filter_fn == NULL) || filter_fn((BMElem *)l_src[j], user_data)) {
+						bm_loop_attrs_copy(bm, bm, l_src[j], l_dst[j]);
+						BM_ELEM_API_FLAG_ENABLE(l_dst[j], _FLAG_OVERLAP);
+					}
+				}
 			}
 		}
 	} while ((l_iter = l_iter->next) != l_first);
+
+
+	l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+	do {
+		BM_ELEM_API_FLAG_DISABLE(l_iter, _FLAG_OVERLAP);
+	} while ((l_iter = l_iter->next) != l_first);
 }
 
 /**

Modified: branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.h
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.h	2013-09-06 16:07:49 UTC (rev 59883)
+++ branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_construct.h	2013-09-06 17:45:58 UTC (rev 59884)
@@ -32,7 +32,8 @@
 BMFace *BM_face_create_quad_tri(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4,
                                 const BMFace *f_example, const eBMCreateFlag create_flag);
 
-void BM_face_copy_shared(BMesh *bm, BMFace *f);
+void BM_face_copy_shared(BMesh *bm, BMFace *f,
+                         BMElemFilterFunc filter_fn, void *user_data);
 
 BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, const int len,
                             const BMFace *f_example, const eBMCreateFlag create_flag);

Modified: branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_queries.h
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_queries.h	2013-09-06 16:07:49 UTC (rev 59883)
+++ branches/soc-2013-rigid_body_sim/source/blender/bmesh/intern/bmesh_queries.h	2013-09-06 17:45:58 UTC (rev 59884)
@@ -27,8 +27,6 @@
  *  \ingroup bmesh
  */
 
-typedef bool (*BMElemFilterFunc)(BMElem *, void *user_data);
-
 bool    BM_vert_in_face(BMFace *f, BMVert *v);
 int     BM_verts_in_face_count(BMFace *f, BMVert **varr, int len);
 bool    BM_verts_in_face(BMFace *f, BMVert **varr, int len);

Modified: branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_hull.c
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_hull.c	2013-09-06 16:07:49 UTC (rev 59883)
+++ branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_hull.c	2013-09-06 17:45:58 UTC (rev 59884)
@@ -136,7 +136,7 @@
 
 				/* Create new hull face */
 				f = BM_face_create_verts(bm, t->v, 3, example, BM_CREATE_NO_DOUBLE, true);
-				BM_face_copy_shared(bm, f);
+				BM_face_copy_shared(bm, f, NULL, NULL);
 			}
 			/* Mark face for 'geom.out' slot and select */
 			BMO_elem_flag_enable(bm, f, HULL_FLAG_OUTPUT_GEOM);

Modified: branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_inset.c
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_inset.c	2013-09-06 16:07:49 UTC (rev 59883)
+++ branches/soc-2013-rigid_body_sim/source/blender/bmesh/operators/bmo_inset.c	2013-09-06 17:45:58 UTC (rev 59884)
@@ -820,7 +820,7 @@
 #if 0
 		/* don't use this because face boundaries have no adjacent loops and won't be filled in.
 		 * instead copy from the opposite side with the code below */
-		BM_face_copy_shared(bm, f);
+		BM_face_copy_shared(bm, f, NULL, NULL);
 #else
 		{
 			/* 2 inner loops on the edge between the new face and the original */




More information about the Bf-blender-cvs mailing list