Fix T59389: Solidify Modifier does not work with 'beveled' Curve objects.

Curve modifier eval code was actually doing nothing to ensure we passed
mesh with valid normals when required by the modifier.

This is a bit basic, rough code, but think it should cover all cases,
time will say...
This commit is contained in:
Bastien Montagne 2018-12-27 15:01:48 +01:00
parent 4f98266cf6
commit f1bf604804
Notes: blender-bot 2023-02-14 08:42:54 +01:00
Referenced by issue #59389, Solidify Modifier does not work with 'beveled' Curve objects
1 changed files with 19 additions and 0 deletions

View File

@ -965,6 +965,19 @@ static void curve_calc_modifiers_post(
if (!modifier_isEnabled(scene, md, required_mode))
continue;
/* If we need normals, no choice, have to convert to mesh now. */
if (mti->dependsOnNormals != NULL && mti->dependsOnNormals(md) && modified == NULL) {
if (vertCos != NULL) {
displist_apply_allverts(dispbase, vertCos);
}
if (ELEM(ob->type, OB_CURVE, OB_FONT) && (cu->flag & CU_DEFORM_FILL)) {
curve_to_filledpoly(cu, nurb, dispbase);
}
modified = BKE_mesh_new_nomain_from_curve_displist(ob, dispbase);
}
if (mti->type == eModifierTypeType_OnlyDeform ||
(mti->type == eModifierTypeType_DeformOrConstruct && !modified))
{
@ -972,6 +985,9 @@ static void curve_calc_modifiers_post(
if (!vertCos) {
vertCos = BKE_mesh_vertexCos_get(modified, &totvert);
}
if (mti->dependsOnNormals != NULL && mti->dependsOnNormals(md)) {
BKE_mesh_ensure_normals(modified);
}
mti->deformVerts(md, &mectx_deform, modified, vertCos, totvert);
}
else {
@ -1021,6 +1037,9 @@ static void curve_calc_modifiers_post(
vertCos = NULL;
}
if (mti->dependsOnNormals != NULL && mti->dependsOnNormals(md)) {
BKE_mesh_ensure_normals(modified);
}
mesh_applied = mti->applyModifier(md, &mectx_apply, modified);
if (mesh_applied) {