diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-27 05:28:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-27 05:28:25 +0400 |
commit | f83a93e454e4a92d9619bc5bd16d73525e41ce46 (patch) | |
tree | 595264dbcf15b38e3f85c2238facea799fe28277 /source/blender/editors | |
parent | ae654301b041cae9cce8107614c1d17bae3ff12a (diff) |
bmesh todo, unlikly but possible - entering editmode with faces and no polys.
rather then printing a warning and failing - convert them to polys.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 12 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 1c889a6169e..5d2bb359d3c 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -265,16 +265,12 @@ void EDBM_MakeEditBMesh(ToolSettings *ts, Scene *UNUSED(scene), Object *ob) Mesh *me = ob->data; BMesh *bm; - if (!me->mpoly && me->totface) { - fprintf(stderr, "%s: bmesh conversion issue! may lose lots of geometry! (bmesh internal error)\n", __func__); - - /* BMESH_TODO need to write smarter code here */ - bm = BKE_mesh_to_bmesh(me, ob); - } - else { - bm = BKE_mesh_to_bmesh(me, ob); + if (UNLIKELY(!me->mpoly && me->totface)) { + BKE_mesh_convert_mfaces_to_mpolys(me); } + bm = BKE_mesh_to_bmesh(me, ob); + if (me->edit_btmesh) { /* this happens when switching shape keys */ BMEdit_Free(me->edit_btmesh); diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 0f2ad28b400..fe3fe698626 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -811,7 +811,7 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface) int tessface_input = FALSE; if (mesh->totface > 0 && mesh->totpoly == 0) { - convert_mfaces_to_mpolys(mesh); + BKE_mesh_convert_mfaces_to_mpolys(mesh); /* would only be converting back again, don't bother */ tessface_input = TRUE; |