diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-26 12:57:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-26 12:57:28 +0300 |
commit | f2a8b74c2572258391c5847c177e59266aee3dab (patch) | |
tree | 0b3d7d1822beb32d335b0689bb04bb0a3a36f98c /source/blender/blenkernel/intern/displist.c | |
parent | 3b24ece297afc8ee648f91dbbe890d8aaee7e3bc (diff) | |
parent | f78ba0df02a9734740d7ccddbe315020f56852f6 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/displist.c')
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 22cb70e3d10..44f284d043e 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -169,10 +169,12 @@ void BKE_displist_normals_add(ListBase *lb) if (dl->nors == NULL) { dl->nors = MEM_callocN(sizeof(float) * 3, "dlnors"); - if (dl->verts[2] < 0.0f) + if (dl->flag & DL_BACK_CURVE) { dl->nors[2] = -1.0f; - else + } + else { dl->nors[2] = 1.0f; + } } } else if (dl->type == DL_SURF) { @@ -471,6 +473,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj sf_arena = BLI_memarena_new(BLI_SCANFILL_ARENA_SIZE, __func__); while (cont) { + int dl_flag_accum = 0; cont = 0; totvert = 0; nextcol = 0; @@ -516,6 +519,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj nextcol = 1; } } + dl_flag_accum |= dl->flag; } dl = dl->next; } @@ -528,6 +532,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj if (tot) { dlnew = MEM_callocN(sizeof(DispList), "filldisplist"); dlnew->type = DL_INDEX3; + dlnew->flag = (dl_flag_accum & (DL_BACK_CURVE | DL_FRONT_CURVE)); dlnew->col = colnr; dlnew->nr = totvert; dlnew->parts = tot; @@ -605,6 +610,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) dlnew->nr = dl->parts; dlnew->parts = 1; dlnew->type = DL_POLY; + dlnew->flag = DL_BACK_CURVE; dlnew->col = dl->col; dlnew->charidx = dl->charidx; @@ -625,6 +631,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) dlnew->nr = dl->parts; dlnew->parts = 1; dlnew->type = DL_POLY; + dlnew->flag = DL_FRONT_CURVE; dlnew->col = dl->col; dlnew->charidx = dl->charidx; |