diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-29 13:18:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-29 13:18:35 +0400 |
commit | ac0568d85660490b90dc1d7c633557ab59bc635e (patch) | |
tree | 12034c1d7f0177f7395de131e1716134a06e3a1e /source/blender | |
parent | 1300721d57a17eb34e4a8b785ef93357a75a9fb3 (diff) |
fix [#36280] Dynamic Topology crashes with active face
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 7229e36f564..4b7c2995ea7 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4588,14 +4588,21 @@ void sculpt_dynamic_topology_enable(bContext *C) 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); |