diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-15 01:42:38 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-15 01:42:38 +0400 |
commit | 3cf39fc72a36bab1c5b82ae96cffe7dd01ce7260 (patch) | |
tree | 9de661afa0bd81b257dbb3b09a82343c42752552 /source | |
parent | 0c51010c67f70fa901b74d941c041f06df50201a (diff) |
Fix T39740: New Autosmooth instant crash entering Edit Mode
One should always be wary of last minute changes, especially in comples code area... :/
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index bad365a9fcd..ee7dc8139d1 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -570,7 +570,13 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, const float (*vcos)[3], const while (true) { /* Much simpler than in sibling code with basic Mesh data! */ lfan_pivot_next = BM_vert_step_fan_loop(lfan_pivot, &e_next); - BLI_assert(lfan_pivot_next->v == v_pivot); + if (lfan_pivot_next) { + BLI_assert(lfan_pivot_next->v == v_pivot); + } + else { + /* next edge is non-manifold, we have to find it ourselves! */ + e_next = (lfan_pivot->e == e_next) ? lfan_pivot->prev->e : lfan_pivot->e; + } /* Compute edge vector. * NOTE: We could pre-compute those into an array, in the first iteration, instead of computing them |