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
This commit is contained in:
Philipp Oeser 2021-07-27 12:04:52 +02:00
parent 7d0765cbdc
commit dfc597202f
Notes: blender-bot 2023-02-14 06:00:51 +01:00
Referenced by issue #90213, Curve dimensions are broken, modifiers aren't applied
Referenced by issue #90154, Regression: can`t select  beveled curves and they disappear on zoom
1 changed files with 2 additions and 3 deletions

View File

@ -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;