[Bf-blender-cvs] [f1bf604804f] master: Fix T59389: Solidify Modifier does not work with 'beveled' Curve objects.

Bastien Montagne noreply at git.blender.org
Thu Dec 27 15:04:28 CET 2018


Commit: f1bf604804f9652378ecdfb7d5afaa5ee99d4a24
Author: Bastien Montagne
Date:   Thu Dec 27 15:01:48 2018 +0100
Branches: master
https://developer.blender.org/rBf1bf604804f9652378ecdfb7d5afaa5ee99d4a24

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...

===================================================================

M	source/blender/blenkernel/intern/displist.c

===================================================================

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) {



More information about the Bf-blender-cvs mailing list