diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 97f229439e6..8e2cecf6a48 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -310,22 +310,19 @@ static DerivedMesh *applyModifier( } for (i = 0, mp = orig_mpoly; i < numFaces; i++, mp++) { - unsigned int ml_v1; - unsigned int ml_v2; int j; ml = orig_mloop + mp->loopstart; - for (j = 0, ml_v2 = ml[mp->totloop - 1].v; - j < mp->totloop; - j++, ml++, ml_v2 = ml_v1) - { - ml_v1 = ml->v; + for (j = 0; j < mp->totloop; j++, ml++) { /* add edge user */ eidx = ml->e; if (edge_users[eidx] == INVALID_UNUSED) { + unsigned int ml_v_next = (j + 1 != mp->totloop) ? ml[1].v : ml[-j].v; ed = orig_medge + eidx; - edge_users[eidx] = (ml_v1 < ml_v2) == (ed->v1 < ed->v2) ? i : (i + numFaces); + BLI_assert(ELEM(ml->v, ed->v1, ed->v2) && + ELEM(ml_v_next, ed->v1, ed->v2)); + edge_users[eidx] = (ml->v > ml_v_next) == (ed->v1 < ed->v2) ? i : (i + numFaces); edge_order[eidx] = j; } else { |