[Bf-blender-cvs] [5977ed34709] blender-v2.82-release: Fix T68489: Shrinkwrap modifier with project not working for curves

Philipp Oeser noreply at git.blender.org
Wed Jan 15 10:00:53 CET 2020


Commit: 5977ed34709ce56823ef755d9c702b8cebba1edd
Author: Philipp Oeser
Date:   Wed Jan 8 13:25:38 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB5977ed34709ce56823ef755d9c702b8cebba1edd

Fix T68489: Shrinkwrap modifier with project not working for curves

rB4cde92303f3d made a MESH-only check (but that is no longer mandatory
since the Mesh is fetched by MOD_deform_mesh_eval_get instead of ctx-
>object->data now...). This would fail for projecting beveled curves
(resulting mesh missing), now also get the mesh for curves if we use
MOD_SHRINKWRAP_PROJECT (and only then).

Maniphest Tasks: T68489

Differential Revision: https://developer.blender.org/D6548

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

M	source/blender/modifiers/intern/MOD_shrinkwrap.c

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

diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c
index b8d0b19b7bf..6e4b0edb004 100644
--- a/source/blender/modifiers/intern/MOD_shrinkwrap.c
+++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c
@@ -108,8 +108,10 @@ static void deformVerts(ModifierData *md,
   struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
   Mesh *mesh_src = NULL;
 
-  if (ctx->object->type == OB_MESH) {
-    /* mesh_src is only needed for vgroups. */
+  if (ELEM(ctx->object->type, OB_MESH, OB_LATTICE) ||
+      (swmd->shrinkType == MOD_SHRINKWRAP_PROJECT)) {
+    /* mesh_src is needed for vgroups, but also used as ShrinkwrapCalcData.vert when projecting.
+     * Avoid time-consuming mesh conversion for curves when not projecting. */
     mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false);
   }



More information about the Bf-blender-cvs mailing list