przemir / ApplyModifierForObjectWithShapeKeys

Blender script
MIT License
248 stars 34 forks source link

armature constraints that transform the mesh also transform in new shape keys #11

Closed senshellshark closed 3 years ago

senshellshark commented 3 years ago

I have found this happen at least with scaling bones as part of a bone constraint. Can be worked around by disabling the armature modifier in the viewport, use the plugin, and then enable again.

przemir commented 3 years ago

I don't think I understand what the problem is. Could you provide easy example or steps required for problem to occur?

I could disable/enable armature modifiers (if they were enabled during script) but what if user would like to keep armature modifier during applying modifier? Subsurface doesn't require it, but some modifiers may use non-rest pose... although they are likely to fail due to different number of vertices for key shapes. Maybe a checkbox "Disable armatures" in dialog panel should suffice?

senshellshark commented 3 years ago

For example a character model that has oval eyes. For this effect the eye bones share a parent bone that has a bone constraint that scales it vertically on originally spherical eyes. If the armature is left enabled and the plugin runs it's action the scaling of the eyes becomes part of those blend shapes. Now when those blend shapes are used you have the effect of the bones scaling the eyes on top of them being scaled as part of the recreated blend shapes and become even longer but also look weird when rotating around. This happened to be for both mirror and subdivision modifiers.

I think having a checkbox option would be nice and it would just have to turn it off and then back on again "Don't include armature deformation" it could say. I can't quite imagine a situation where you would want to include such deformations from an armature anyways because they wouldn't exist in the original anyways, they work independently, it seems like a behavior that could be default potentially.

Thank you for working on this by the way, this plugin is incredibly handy.

przemir commented 3 years ago

Ok. I was able to reproduce wrong situation - just bone scale was enough.

I added checkbox, enabled by default.