[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57296] trunk/blender/source/blender/ editors/armature/meshlaplacian.c: Fix #35671: automatic armature weights assignment crashed with an empty mesh.

Brecht Van Lommel brechtvanlommel at pandora.be
Sat Jun 8 19:56:45 CEST 2013


Revision: 57296
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57296
Author:   blendix
Date:     2013-06-08 17:56:45 +0000 (Sat, 08 Jun 2013)
Log Message:
-----------
Fix #35671: automatic armature weights assignment crashed with an empty mesh.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/armature/meshlaplacian.c

Modified: trunk/blender/source/blender/editors/armature/meshlaplacian.c
===================================================================
--- trunk/blender/source/blender/editors/armature/meshlaplacian.c	2013-06-08 17:56:40 UTC (rev 57295)
+++ trunk/blender/source/blender/editors/armature/meshlaplacian.c	2013-06-08 17:56:45 UTC (rev 57296)
@@ -659,6 +659,17 @@
 
 	*err_str = NULL;
 
+	/* bone heat needs triangulated faces */
+	BKE_mesh_tessface_ensure(me);
+
+	for (tottri = 0, a = 0, mf = me->mface; a < me->totface; mf++, a++) {
+		tottri++;
+		if (mf->v4) tottri++;
+	}
+
+	if (tottri == 0)
+		return;
+
 	/* count triangles and create mask */
 	if ((use_face_sel = ((me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0)) ||
 	    (use_vert_sel = ((me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0)))
@@ -686,14 +697,6 @@
 		}
 	}
 
-	/* bone heat needs triangulated faces */
-	BKE_mesh_tessface_ensure(me);
-
-	for (tottri = 0, a = 0, mf = me->mface; a < me->totface; mf++, a++) {
-		tottri++;
-		if (mf->v4) tottri++;
-	}
-
 	/* create laplacian */
 	sys = laplacian_system_construct_begin(me->totvert, tottri, 1);
 




More information about the Bf-blender-cvs mailing list