Fix: correct logical error accumulating DispList flags

Flags were added from DispList's which weren't included in the
tessellated DispList.

Also use const reference when iterating over faces.

Ref !153104
This commit is contained in:
Campbell Barton 2026-01-21 11:50:53 +11:00
parent 9cc24f59da
commit 44cabb12ee

View file

@ -308,6 +308,9 @@ void BKE_displist_fill(const ListBaseT<DispList> *dispbase,
if (sf_vert != nullptr && sf_vert_new != nullptr) {
BLI_scanfill_edge_add(&sf_ctx, sf_vert, sf_vert_new);
}
dl_flag_accum |= dl.flag;
dl_rt_accum |= dl.rt;
}
else if (colnr < dl.col) {
/* got poly with next material at current char */
@ -315,8 +318,6 @@ void BKE_displist_fill(const ListBaseT<DispList> *dispbase,
nextcol = true;
}
}
dl_flag_accum |= dl.flag;
dl_rt_accum |= dl.rt;
}
}
@ -342,7 +343,7 @@ void BKE_displist_fill(const ListBaseT<DispList> *dispbase,
/* index data */
int *index = dlnew->index;
for (ScanFillFace &sf_tri : sf_ctx.fillfacebase) {
for (const ScanFillFace &sf_tri : sf_ctx.fillfacebase) {
index[0] = sf_tri.v1->tmp.i;
index[1] = flip_normal ? sf_tri.v3->tmp.i : sf_tri.v2->tmp.i;
index[2] = flip_normal ? sf_tri.v2->tmp.i : sf_tri.v3->tmp.i;