diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-04-24 20:11:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-04-24 20:11:36 +0300 |
commit | a14735d11d2e16f24f63513d58b1d95864bdf27f (patch) | |
tree | 36e91749e07e1a4f5af0196cc39a1f183da716dc /source/blender/blenkernel/intern/displist.c | |
parent | c265e25bb1752135e9541789dd1fb6275e4f8309 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/displist.c')
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 9 |
1 files changed, 6 insertions, 3 deletions
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); |