powroupi / blender_mmd_tools

mmd_tools is a blender addon for importing Models and Motions of MikuMikuDance.
GNU General Public License v3.0
1.81k stars 277 forks source link

Can't export certain Blender-generated shape keys #331

Closed nintendraw closed 3 years ago

nintendraw commented 3 years ago

I have a set of shape keys made entirely in Blender that I want to export out of Blender ("close jacket", "tall boots", "high back", and "straight leg"), but only some actually show up in my destination program. Specifically, "close jacket" doesn't show up correctly (only one/the "zipper" object is affected) and "straight leg" doesn't show up at all. If I try to export the different pants shapes separately and recreate the morph in PMX Editor (load original pants -> create vertex morph -> load straight-leg pants -> save new morph), the mesh data gets corrupted or something else happens to cause the final shape to look like a spiky, glitchy mess even though the new shape (straight-leg pants) previewed correctly during PMXe morph creation. Why does this happen, and how can I fix it? I've attached a Blend file here for anyone who can help. Thanks!

nagadomi commented 3 years ago

PMX morph can be created with MMD tab > Morph Tools panel.

  1. Select Vertex tab
  2. Press the "+" button to add a new morph
  3. Double-click on the name and rename it to the name of the shape key
  4. Select a category such as Other / Eye / Mouth ...
nintendraw commented 3 years ago

I know how to make and categorize vertex morphs and add them to the eventual MMD display, but the morphs weren't exporting at all. I found on Blender StackExchange that this was due to having "live, generated modifiers" (like Mirror) active--exporting the model without applying those causes the exporter to apply them strangely.

nagadomi commented 3 years ago

I checked your blend file. The problem is that the Mirror Modifier's Merge option is checked, and the vertices that are moved by the shape key cross( or move away from) the center, so the number of vertices that are merged changes depending on the shape key ON/OFF state, so the export fails due to a vertex count mismatch error. This may be fixed by making sure that the center vertex is not moved by the shape key.