Mesh which has Mirror Modifier with Merge option causes "Shape keys ended up with different number of vertices" error.
When I try to do "Apply modifier for object with shape key with mesh" with mirror modifier, I got this error
"Error: Shape keys ended up with different number of vertices! All shape keys needs to have the same number of vertices after modifier is applied. Otherwise joining such shape keys will fail!"
and I found out the reason why. when mirror modifier's "Merge" option is checked but original part of mesh and mirrored part aren't merged this error happens. (like mirror Axis is X and Merge distance is set as 1m but some vertices are placed on 10 m away from X axis, those vertices can't be merged.) I guess It's because this script is supposed to work with mesh which don't have non-manifold vertices made by mirror modifier. when cube plane is mirrored with mirror modifier(Merge option checked) it must have 6 vertices but if it fails to merge it must have 8 vertices then shape keys aren't thought to have the same number of vertices, then above error happens.
It's was hard for me to find out why this error happens. My mesh looks fine, All symmetrical points of X coordinate looks X 0 coordinate, but one of my mesh's shape key has vertices with X 0.1 coordinate and I moved them to X 0 in another shape key so when this script is executed those vertices with X 0.1 coordinate causes this error.
This can be fixed? If it can't at lease it needs to show a error message which tells us why this happens.
Many modifiers can cause this error and script knows only that it tries to join objects with different number of vertices - it will fail even if user tried to go trough that process of splitting shape keys, applying modifiers and joining shape keys manually. Even this mirror modifier with merge option enabled may sometimes work (if there was not merge or the same merge on each shape key).
Because mirror modifier with "Merge" property enabled may be tricky and popular I added text "Hint: There is mirror modifier with 'Merge' property enabled. This may cause a problem." after error message if among selected modifiers is mirror modifier with this property enabled. I would rather avoid changing those problematic properties for user automatically.