[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58715] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: fix [#36280] Dynamic Topology crashes with active face

Campbell Barton ideasman42 at gmail.com
Mon Jul 29 11:18:35 CEST 2013


Revision: 58715
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58715
Author:   campbellbarton
Date:     2013-07-29 09:18:35 +0000 (Mon, 29 Jul 2013)
Log Message:
-----------
fix [#36280] Dynamic Topology crashes with active face

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-07-29 09:12:23 UTC (rev 58714)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-07-29 09:18:35 UTC (rev 58715)
@@ -4588,14 +4588,21 @@
 	Object *ob = CTX_data_active_object(C);
 	SculptSession *ss = ob->sculpt;
 	Mesh *me = ob->data;
+	const BMAllocTemplate allocsize = {me->totvert,
+	                                   me->totedge,
+	                                   me->totloop,
+	                                   me->totpoly};
 
 	sculpt_pbvh_clear(ob);
 
 	ss->bm_smooth_shading = (scene->toolsettings->sculpt->flags &
 	                         SCULPT_DYNTOPO_SMOOTH_SHADING);
 
+	/* Dynamic topology doesn't ensure selection state is valid, so remove [#36280] */
+	BKE_mesh_mselect_clear(me);
+
 	/* Create triangles-only BMesh */
-	ss->bm = BM_mesh_create(&bm_mesh_allocsize_default);
+	ss->bm = BM_mesh_create(&allocsize);
 
 	BM_mesh_bm_from_me(ss->bm, me, true, true, ob->shapenr);
 	sculpt_dynamic_topology_triangulate(ss->bm);




More information about the Bf-blender-cvs mailing list