diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-12-27 17:01:48 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-12-27 17:03:06 +0300 |
commit | f1bf604804f9652378ecdfb7d5afaa5ee99d4a24 (patch) | |
tree | 2e1d234908d5a7bce4a1f67fdcc5127788988f5e /source/blender/blenkernel | |
parent | 4f98266cf6c7c40f1d4de4fb847d3d61644144de (diff) |
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...
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index c985de94854..c5dadb1b529 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -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) { |