diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-04 13:36:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-04 13:56:57 +0300 |
commit | abd68c6e45a67ff682f13000d1ae2f8b79edea22 (patch) | |
tree | 87fa02bc9a6aa9ad2ba9396682acde7c60478b0a | |
parent | 8d5eeab473110ee102b68fedfe74b4404f7cc07f (diff) |
Fix T42893: Skin Modifier, changes randomly toggling editmode
Own regression, previously it would do a full mesh normal calculation for each isolated shape
(could hang on meshes with many loose parts).
However the normals are needed, instead of doing a full calculation,
just set normals on new faces.
Thanks to Brecht for finding cause!
-rw-r--r-- | source/blender/modifiers/intern/MOD_skin.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 02515360f3a..155c76638f9 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -249,6 +249,7 @@ static bool build_hull(SkinOutput *so, Frame **frames, int totframe) /* Apply face attributes to hull output */ BMO_ITER (f, &oiter, op.slots_out, "geom.out", BM_FACE) { + BM_face_normal_update(f); if (so->smd->flag & MOD_SKIN_SMOOTH_SHADING) BM_elem_flag_enable(f, BM_ELEM_SMOOTH); f->mat_nr = so->mat_nr; @@ -960,6 +961,7 @@ static void add_poly(SkinOutput *so, BLI_assert(v1 && v2 && v3); f = BM_face_create_verts(so->bm, verts, v4 ? 4 : 3, NULL, BM_CREATE_NO_DOUBLE, true); + BM_face_normal_update(f); if (so->smd->flag & MOD_SKIN_SMOOTH_SHADING) BM_elem_flag_enable(f, BM_ELEM_SMOOTH); f->mat_nr = so->mat_nr; @@ -1421,6 +1423,9 @@ static void hull_merge_triangles(SkinOutput *so, const SkinModifierData *smd) if (adj[0]->len == 3 && adj[1]->len == 3) { BMVert *quad[4]; + BLI_assert(BM_face_is_normal_valid(adj[0])); + BLI_assert(BM_face_is_normal_valid(adj[1])); + /* Construct quad using the two triangles adjacent to * the edge */ quad_from_tris(e, adj, quad); |