From a14735d11d2e16f24f63513d58b1d95864bdf27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 24 Apr 2019 19:11:28 +0200 Subject: Fix T61184 linked curves with curve modifiers arent drawn correctly Force Displist to Mesh conversion if there is any modifier. This is until we find a better way to store the batches per objects. Also fix draw cache functions that were not returning final mesh edges. --- source/blender/blenkernel/intern/displist.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/displist.c') diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index e3ee28ed022..c228595b6e8 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1028,7 +1028,10 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, } /* If we need normals, no choice, have to convert to mesh now. */ - if (mti->dependsOnNormals != NULL && mti->dependsOnNormals(md) && modified == NULL) { + bool need_normal = mti->dependsOnNormals != NULL && mti->dependsOnNormals(md); + /* XXX 2.8 : now that batch cache is stored inside the ob->data + * we need to create a Mesh for each curve that uses modifiers. */ + if (modified == NULL /* && need_normal */) { if (vertCos != NULL) { displist_apply_allverts(dispbase, vertCos); } @@ -1046,7 +1049,7 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, if (!vertCos) { vertCos = BKE_mesh_vertexCos_get(modified, &totvert); } - if (mti->dependsOnNormals != NULL && mti->dependsOnNormals(md)) { + if (need_normal) { BKE_mesh_ensure_normals(modified); } mti->deformVerts(md, &mectx_deform, modified, vertCos, totvert); @@ -1095,7 +1098,7 @@ static void curve_calc_modifiers_post(Depsgraph *depsgraph, vertCos = NULL; } - if (mti->dependsOnNormals != NULL && mti->dependsOnNormals(md)) { + if (need_normal) { BKE_mesh_ensure_normals(modified); } mesh_applied = mti->applyModifier(md, &mectx_apply, modified); -- cgit v1.2.3