From dfc597202f769e493b145adb27407f1691102e15 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 27 Jul 2021 12:04:52 +0200 Subject: Fix T90154, T90213: curve issues since recent cleanup commit Caused by {rB8cbff7093d65}. Since above commit only one modifier would get calculated and the displaylist boundingbox was calculated wrong. Maniphest Tasks: T90154 Differential Revision: https://developer.blender.org/D12037 --- source/blender/blenkernel/intern/displist.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index a4ffaa8b10b..99dc1db9d38 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -903,6 +903,7 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, Mesh *modified = nullptr; float(*vertCos)[3] = nullptr; + int totvert = 0; for (; md; md = md->next) { const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type); @@ -929,7 +930,6 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, if (mti->type == eModifierTypeType_OnlyDeform || (mti->type == eModifierTypeType_DeformOrConstruct && !modified)) { if (modified) { - int totvert = 0; if (!vertCos) { vertCos = BKE_mesh_vert_coords_alloc(modified, &totvert); } @@ -939,7 +939,6 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, mti->deformVerts(md, &mectx_deform, modified, vertCos, totvert); } else { - int totvert = 0; if (!vertCos) { vertCos = displist_vert_coords_alloc(dispbase, &totvert); } @@ -1668,7 +1667,7 @@ void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3]) LISTBASE_FOREACH (const DispList *, dl, dispbase) { const int tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts; for (const int i : IndexRange(tot)) { - minmax_v3v3_v3(min, max, &dl->verts[i]); + minmax_v3v3_v3(min, max, &dl->verts[i * 3]); } if (tot != 0) { doit = true; -- cgit v1.2.3