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
This commit is contained in:
Philipp Oeser 2020-01-08 13:25:38 +01:00
parent d68346eacf
commit 5977ed3470
Notes: blender-bot 2023-02-14 06:42:54 +01:00
Referenced by issue #68489, Shrinkwrap modifier with proyect not working in curves
1 changed files with 4 additions and 2 deletions

View File

@ -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);
}