Page MenuHome

MeshDeform Modifier does not work on a solidified planar mesh
Closed, ResolvedPublic

Description

System Information
Operating system: Ubuntu 18.04
Graphics card: Intel Onboard

Blender Version
Broken: 2.80, 66c23ea2b4a4, 2019-02-09 20:41
Worked: Blender 2.79

MeshDeform Modifier does not work on a solidified planar mesh

Exact steps for others to reproduce the error
Load meshdeform_bug.blend into Blender. (File attached).

There is a collection with name "SolidifyBug". It contains a plane and a donut.
If you deform the plane, there is no deformation on the donut.

If you apply solidify to the plane, and re-bind the donut's meshdeform modifier, everything works fine.

Event Timeline

Philipp Oeser (lichtwerk) claimed this task.
Philipp Oeser (lichtwerk) triaged this task as Confirmed, Medium priority.

Confirmed, checking...

This was indeed working fine in 2.79.
In 2.8 it updates fine if you go back to objectmode.
Once you enter editmode on the plane, I am getting this here:
ERROR (bke.modifier): /blender/source/blender/blenkernel/intern/modifier.c:385 modifier_setError: Cage verts changed from 162 to 81
So looks like BKE_modifier_get_evaluated_mesh_from_evaluated_object doesnt really give us fully evaluated mesh (at least not for objects with generative modifiers in editmode)?

There is also this comment [which is probably true -- and the reason for all this?]

/* Note: currently we have no equivalent to derived cagemesh or even final dm in BMEditMesh... This is TODO in core depsgraph/modifier stack code still. */


Another note:
reading this comment for BKE_modifier_get_evaluated_mesh_from_evaluated_object suggests it is not neccessary to call DEG_get_evaluated_object() on mmd->object prior?:

  • Note that modifiers in stack always get fully evaluated COW ID pointers, never original ones. Makes things simpler.

But everywhere in modifiers where BKE_modifier_get_evaluated_mesh_from_evaluated_object is called, DEG_get_evaluated_object is actually called prior?


Some (uneducated and failing) doodle with how BKE_modifier_get_evaluated_mesh_from_evaluated_object in P909, [that will remove the error about mismatching Cage verts, but still fails to deform -- aaand is probably totally against design...]


Summing this up: this is probably over my head, would like to get @Bastien Montagne (mont29) and @Sergey Sharybin (sergey) onboard...

BKE_modifier_get_evaluated_mesh_from_evaluated_object() is doing plain rubbish in EditMode case… That was probably true at the time it was written, but we do have valid final and deformed (aka cage) evaluated meshes in BMEditMesh, nowadays. So fix is actually quite simple. ;)

we do have valid final and deformed (aka cage) evaluated meshes in BMEditMesh, nowadays. So fix is actually quite simple. ;)

doh! thats a facepalm on my side... thx @Bastien Montagne (mont29)

Thank you for your effort. It works now.

I rely on Solidify&MeshDeform for elephant ears or dragon wing. SurfaceDeform could not be limited to membrane areas (Vertex Groups), it deforms whole mesh.