How to apply Corrective Smooth as Shapekey?

Blender has a Corrective Smooth modifier, which is nice. I’m building a character for realtime, so I can’t use it directly. But I figured I’d take advantage of it by using it to create corrective shapekeys. The modifier does have an “Apply as Shapekey” button after all, and it would be a good basis for further manual tweaking.

However, the button doesn’t seem to work.

For Corrective Smooth to do its thing it needs an Armature above it in the stack. However, with the Armature modifier there, it fails with an “Applied modifier was not first, the result may not be as expected” message.

So basically, how can you apply Corrective Smooth as a Shapekey? Is it just a completely useless button that can’t ever work, or is there something I'm overlooking?

• It's not an error- just a warning message. You will find the shape keys here: docs.blender.org/manual/en/latest/animation/shape_keys/… . If I click on the "Apply as Shapekey" button (with an armature modifier above) the Blender creates a new shape key, but it is the same as the basis. I don't think this could be work. – FFeller May 28 '19 at 19:32
• That's what I mean by "fails". It doesn't do anything useful. – MadMinstrel May 28 '19 at 19:34

This is a quirk of how the Apply as Shapekey works. The mechanism is outside the specific modifier's logic.

Essentially when you click Apply as Shapekey blender takes the unmodified mesh and adds just the modifier that your are applying to the mesh, then uses the resulting shape. For corrective smooth, this means nothing happens, as corrective smooth needs other deformation in order to do anything.

There is however a workaround for this. Blender comes bundled with and addon called Corrective Shape Key which can generate a shape from the whole combined mesh as a corrective shape. To do this you need to first use the addon to create a duplicate for editing, and then disable the corrective smooth, and then add the dupe back as new shape using the addon's functionality to reverse transforms.

• That's a nice reply, thanks, but not marking this as solved just yet because the addon doesn't seem like it works with 2.8 at the moment. – MadMinstrel May 29 '19 at 3:22
• Thats annoying, I don't think there should be anything much in there that would make porting it hard. – Sazerac May 29 '19 at 3:57

I needed to apply the whole modifier stack as shape keys as well. Here is how i did:

def create_shape_key_from_object_snapshot(self, context, obj, shape_name):

def object_duplicate_flatten_modifiers(obj, shape_name):
depth = context.evaluated_depsgraph_get()
eobj = obj.evaluated_get(depth)
mesh = bpy.data.meshes.new_from_object(eobj)
name = shape_name
new_object = bpy.data.objects.new(name, mesh)
new_object.data = mesh