Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/displist.c
| Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | |||||
| void BKE_displist_count(ListBase *lb, int *totvert, int *totface, int *tottri) | void BKE_displist_count(ListBase *lb, int *totvert, int *totface, int *tottri) | ||||
| { | { | ||||
| DispList *dl; | DispList *dl; | ||||
| for (dl = lb->first; dl; dl = dl->next) { | for (dl = lb->first; dl; dl = dl->next) { | ||||
| int vert_tot = 0; | int vert_tot = 0; | ||||
| int face_tot = 0; | int face_tot = 0; | ||||
| int tri_tot = 0; | int tri_tot = 0; | ||||
| bool cyclic_u = dl->flag & DL_CYCL_U; | |||||
| bool cyclic_v = dl->flag & DL_CYCL_V; | |||||
| switch (dl->type) { | switch (dl->type) { | ||||
| case DL_SURF: | case DL_SURF: | ||||
| { | { | ||||
| int segments_u = dl->nr - (cyclic_u == false); | |||||
| int segments_v = dl->parts - (cyclic_v == false); | |||||
| vert_tot = dl->nr * dl->parts; | vert_tot = dl->nr * dl->parts; | ||||
| face_tot = (dl->nr - 1) * (dl->parts - 1); | face_tot = segments_u * segments_v; | ||||
| tri_tot = face_tot * 2; | tri_tot = face_tot * 2; | ||||
| break; | break; | ||||
| } | } | ||||
| case DL_INDEX3: | case DL_INDEX3: | ||||
| { | { | ||||
| vert_tot = dl->nr; | vert_tot = dl->nr; | ||||
| face_tot = dl->parts; | face_tot = dl->parts; | ||||
| tri_tot = face_tot; | tri_tot = face_tot; | ||||
| ▲ Show 20 Lines • Show All 1,671 Lines • Show Last 20 Lines | |||||