[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51668] trunk/blender/source/blender: fix for filled rip copying loop customdata ( fix in BM_edge_other_loop broke it)

Campbell Barton ideasman42 at gmail.com
Sat Oct 27 03:33:36 CEST 2012


Revision: 51668
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51668
Author:   campbellbarton
Date:     2012-10-27 01:33:33 +0000 (Sat, 27 Oct 2012)
Log Message:
-----------
fix for filled rip copying loop customdata (fix in BM_edge_other_loop broke it)

also assert when customdata can't be copied because of invalid args.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_construct.c
    trunk/blender/source/blender/editors/mesh/editmesh_rip.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_construct.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_construct.c	2012-10-26 18:06:14 UTC (rev 51667)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_construct.c	2012-10-27 01:33:33 UTC (rev 51668)
@@ -725,6 +725,7 @@
                                const BMVert *source_vertex, BMVert *target_vertex)
 {
 	if ((source_mesh == target_mesh) && (source_vertex == target_vertex)) {
+		BLI_assert(!"BMVert: source and targer match");
 		return;
 	}
 	copy_v3_v3(target_vertex->no, source_vertex->no);
@@ -737,6 +738,7 @@
                                const BMEdge *source_edge, BMEdge *target_edge)
 {
 	if ((source_mesh == target_mesh) && (source_edge == target_edge)) {
+		BLI_assert(!"BMEdge: source and targer match");
 		return;
 	}
 	CustomData_bmesh_free_block(&target_mesh->edata, &target_edge->head.data);
@@ -748,6 +750,7 @@
                                const BMLoop *source_loop, BMLoop *target_loop)
 {
 	if ((source_mesh == target_mesh) && (source_loop == target_loop)) {
+		BLI_assert(!"BMLoop: source and targer match");
 		return;
 	}
 	CustomData_bmesh_free_block(&target_mesh->ldata, &target_loop->head.data);
@@ -759,6 +762,7 @@
                                const BMFace *source_face, BMFace *target_face)
 {
 	if ((source_mesh == target_mesh) && (source_face == target_face)) {
+		BLI_assert(!"BMFace: source and targer match");
 		return;
 	}
 	copy_v3_v3(target_face->no, source_face->no);
@@ -781,8 +785,10 @@
 
 	BLI_assert(sheader->htype == theader->htype);
 
-	if (sheader->htype != theader->htype)
+	if (sheader->htype != theader->htype) {
+		BLI_assert(!"type mismatch");
 		return;
+	}
 
 	/* First we copy select */
 	if (BM_elem_flag_test((BMElem *)sheader, BM_ELEM_SELECT)) {

Modified: trunk/blender/source/blender/editors/mesh/editmesh_rip.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_rip.c	2012-10-26 18:06:14 UTC (rev 51667)
+++ trunk/blender/source/blender/editors/mesh/editmesh_rip.c	2012-10-27 01:33:33 UTC (rev 51668)
@@ -496,21 +496,21 @@
 			l_iter = BM_FACE_FIRST_LOOP(f);
 
 			if (f_verts[3]) {
-				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, ulp->l_pair[0]),       l_iter); l_iter = l_iter->next;
-				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, ulp->l_pair[1]->next), l_iter); l_iter = l_iter->next;
-				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, ulp->l_pair[1]),       l_iter); l_iter = l_iter->next;
-				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, ulp->l_pair[0]->next), l_iter);
+				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, l_iter), l_iter); l_iter = l_iter->next;
+				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, l_iter), l_iter); l_iter = l_iter->next;
+				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, l_iter), l_iter); l_iter = l_iter->next;
+				BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, l_iter), l_iter);
 			}
 			else {
 				if (v_shared == f_verts[0]) {
-					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, ulp->l_pair[0]->next), l_iter); l_iter = l_iter->next;
-					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, ulp->l_pair[0]),       l_iter); l_iter = l_iter->next;
-					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, ulp->l_pair[1]->next), l_iter);
+					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, l_iter), l_iter); l_iter = l_iter->next;
+					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, l_iter), l_iter); l_iter = l_iter->next;
+					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, l_iter), l_iter);
 				}
 				else {
-					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, ulp->l_pair[0]->next), l_iter); l_iter = l_iter->next;
-					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, ulp->l_pair[0]),       l_iter); l_iter = l_iter->next;
-					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, ulp->l_pair[1]),       l_iter);
+					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, l_iter), l_iter); l_iter = l_iter->next;
+					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[0]->e, l_iter), l_iter); l_iter = l_iter->next;
+					BM_elem_attrs_copy(bm, bm, BM_edge_other_loop(ulp->l_pair[1]->e, l_iter), l_iter);
 				}
 			}
 




More information about the Bf-blender-cvs mailing list