The problem is that I have a low poly model that works with the subdiv modifier on the renderer. And I need to get the deformation already on a denser mesh. Since blender doesn’t allow me to create shape keys on high subdiv levels, I decided to duplicate the mesh, and apply the subdiv modifier to it. And then deform the original mesh through surface deform with a denser mesh, to which I apply the shape keys. So, if I apply the surface deform to the original mesh without the subdiv modifier, everything binds fine, but if I move the modifier after the subdiv, blender gives the error “Target contains invalid polygons”. But nothing was changed in the target. Only the order of modifiers in the base grid has changed. What could be the problem?
Well, order of modifiers matters. Quite a bit sometimes.
When having problems binding a surface deform, I recommend throwing a triangulate modifier on the target, at the bottom of its modifier stack, and rebinding. Concave polygon errors should usually be fixed by triangulation. (Not sure why this behavior isn’t built into surface deform.) If the mesh is a rendering mesh, then enabling “keep normals” should, in recent versions of Blender, make it look the same (with “fixed” type triangulation, but there are exceptions for some meshes.)
It’s also important that the original mesh is a reasonable mesh-- manifold, used loosely. The important characteristic is that there are no edges that connect more than 2 faces. Loose verts/edges and boundaries should be fine (but try to avoid loose verts/edges anyways.)
Thanks, solved by removing the edges connecting to the three faces