Corrective smooth apply as shape key does not work
Open, NormalPublic

Description

System Information
Window 8.1, Nvidia GTX 770

Blender Version
Broken: 2.74. f8540d7 (from build bot)
Also reported by BlenderArtists forum user DanPro for build dc95ca9

Short description of error
Apply as shape on the corrective smooth modifier creates an empty shape key.
Apply as shape in the same conditions for the smooth modifier works fine.

Exact steps for others to reproduce the error

  1. create mesh skinned to armature (e.g. cylinder skinned to two bones)
  2. add corrective smooth modifier after armature modifier
  3. pose armature
  4. apply corrective smooth modifier as shape (or to mesh)
  5. the resulting shape key would be empty (should contain the corrective smoothing effect for that pose)

File:

Details

Type
Design
Jack Simpson (sazerac) updated the task description. (Show Details)
Jack Simpson (sazerac) raised the priority of this task from to Needs Triage.
Jack Simpson (sazerac) claimed this task.
Jack Simpson (sazerac) set Type to Bug.

This isnt exactly a bug, in at least that the behavior is working as intended, it just happens not to be very useful behavior in the case of corrective smooth modifier, because this is one of the few modifiers that relies on previous modifiers to be applied before it has any effect.

Apply as shape key disables all modifiers except for one, applies it on its own, then applies any changes as a shape.

This happens not to do what you want with *Corrective Smooth*, because this modifier relies on preceding modifiers to deform the original coordinates, before it makes any difference.

You can see that it is working, because enabling 'Only Smooth' before applying as shape, does what you would expect.


I can think of a few ways this could be made to work...

  • It could just apply all deform modifiers up until the corrective smooth modifier. (but that will bake the pose in too - which isn't typically what you want)
  • It could calculate the deformation thats being applied to the previous modifier, then apply the deltas to a shape key on the base mesh (using per vertex tangents).

I'm interested to see how this could work, but its not a software error, moving to design task.

Campbell Barton (campbellbarton) triaged this task as Normal priority.May 11 2015, 5:37 AM
Campbell Barton (campbellbarton) changed Type from Bug to Design.

I can think of a few ways this could be made to work...

  • It could just apply all deform modifiers up until the corrective smooth modifier. (but that will bake the pose in too - which isn't typically what you want)
  • It could calculate the deformation thats being applied to the previous modifier, then apply the deltas to a shape key on the base mesh (using per vertex tangents).

    I'm interested to see how this could work, but its not a software error, moving to design task.

Thanks for the suggestions. I think the second option would be much more useful.
I'm assuming the relevant code here is:
object_modifier.c : modifier_apply_shape
and
DerivedMesh.c : mesh_create_derived_for_modifier

Am I right that mesh_create_derived_for_modifier is only called by the apply/apply as shape functionality?

Looking at how this is done in blender, it looks like any change here would be awfully special-casey just for the one modifier. I guess the second option for apply as shape could potentially work for any modifier at the moment and may actually product more intuitive results in some cases (shrinkwrap on a posed char comes to mind, also useful in some cases for making corrective shapes). However this will obviously change the results of this option, so isn't a change to make lightly.

@Campbell Barton (campbellbarton), what do you think?

@Jack Simpson (sazerac), yep, modifier_apply_shape would need to be changed quite a bit.

Agree using deltas is most useful here, and probably best this is first added as an option, then we can see how to expose.


eg: [Apply, Copy] buttons use quite a bit if space, we could move all into a small single icon menu.
(like what we have already for vertex groups containing options to sort, copy, lock ... etc).

Then we can have Different menu items for applying the shape key.

Or as an alternative we could tag modifier types where it only makes sense to apply the difference as a shape, and do it automatically. (though there could be rare cases you want either options)

Had a bit more of a look/think about this and deriving the correct shape is not trivial, I think this kind of functionality would make more sense as an extension on what is in the corrective shape keys addon.

I too noticed this behavior and expected something different. I created this report here:
https://developer.blender.org/T45293

before finding this thread.

Creating corrective shape keys with the corrective smooth modifier would be really great indeed. I hope it will be added at some point!