[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [61231] trunk/blender/source/blender/bmesh /operators/bmo_fill_grid.c: Fix [#37388] Grid fill crashes blender in specific situation.

Bastien Montagne montagne29 at wanadoo.fr
Mon Nov 11 15:29:02 CET 2013


Revision: 61231
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=61231
Author:   mont29
Date:     2013-11-11 14:29:01 +0000 (Mon, 11 Nov 2013)
Log Message:
-----------
Fix [#37388] Grid fill crashes blender in specific situation.

With some geometries, we can have a valid first path, without being able to find a valid second one, added needed check.

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

Modified: trunk/blender/source/blender/bmesh/operators/bmo_fill_grid.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_fill_grid.c	2013-11-11 12:19:39 UTC (rev 61230)
+++ trunk/blender/source/blender/bmesh/operators/bmo_fill_grid.c	2013-11-11 14:29:01 UTC (rev 61231)
@@ -633,7 +633,12 @@
 		goto cleanup;
 	}
 
-	BM_mesh_edgeloops_find_path(bm, &eloops_rail, bm_edge_test_rail_cb, (void *)bm, v_a_first, v_b_last);
+	/* We may find a first path, but not a second one! See geometry attached to bug [#37388]. */
+	if (BM_mesh_edgeloops_find_path(bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_first, v_b_last) == false) {
+		BMO_error_raise(bm, op, BMERR_INVALID_SELECTION,
+		                "Loops are not connected by wire/boundary edges");
+		goto cleanup;
+	}
 
 	/* Check flipping by comparing path length */
 	estore_rail_a = eloops_rail.first;
@@ -656,7 +661,7 @@
 		BM_edgeloop_free(estore_rail_a);
 		estore_rail_a = estore_rail_b;
 
-		/* reverse so these so both are sorted the same way */
+		/* reverse so both are sorted the same way */
 		BM_edgeloop_flip(bm, estore_b);
 		SWAP(BMVert *, v_b_first, v_b_last);
 




More information about the Bf-blender-cvs mailing list