UuuNyaa / blender_mmd_tools

MMD Tools is a blender addon for importing/exporting Models and Motions of MikuMikuDance.
GNU General Public License v3.0
1.95k stars 92 forks source link

issues with imported fbx axis and VMD file axis not working together #83

Closed wikid24 closed 2 months ago

wikid24 commented 1 year ago

Hey so I'm not experienced in blender at all, I've been working my butt off coding some new python tools to convert FFXIV fbx models to MMD, but I haven't found a way round this one problem yet...

I'm using an FBX file (created from FFXIV TexTools) where the rotation axis for XYZ is not translated properly when attempt to apply a VMD motion file created in MMD.

The VMD file's X axis motion data is being translated to the FBX file's Y axis, and no matter how many settings I change upon attempting to fix this, it's always the same result with my FBX model getting posessed by demons.

Here's a side-by-side of a MMD model imported vs a FBX model I've rigged up using the same VMD file... There's other issues I need to address like fixing the IK bones etc, but I can't really fix them until I get this one solved first... please help!

https://user-images.githubusercontent.com/19479648/212324323-193bb0bc-5b49-41e6-802c-4b56cda532bd.mp4

p

lordscales91 commented 1 year ago

Have you converted the model to a model managed by mmd_tools? If you haven't done so already you can select the armature and use this feature:

mmd tools convert model

However, it is an experimental feature so it might not work properly.

Best of luck

wikid24 commented 1 year ago

I have indeed! The video above is with my using the Convert Model feature, so I'm not quite sure where to take this from here.

I suspect it has something to do with FBX importing the model using a different axis than what MMD Tool is expecting when it loads the VMD file. For reference's sake, the steps are pretty simple for me:

1) Load the FBX File (set Primary axis to X, Secondary to Y) image

2) Use a bone renaming tool to rename the bones to MMD English bone names

3) Use a tool to add the mother, groove, bone and parent it to the waist

4) Add the IK stuff (totally optional, same issue occurs either way)

5) Use a bone renaming tool to rename the bones to MMD Jap bone names

6) 'Convert Model' button via MMD Tools

7) Import VMD File via MMD Tools using Blender Bone names & Current position as rest position

image

8) Enjoy the show.

I've tried almost all the bone orientation adjustment options in the first screenshot where I'm importing the FBX file to see if it could fix it to no avail.

wikid24 commented 1 year ago

Also, here's the updated MMD Tools Helper file I've spent the past week updating, a sample FFXIV FBX file for anyone's testing:

ffxiv_mmd_tools_helper_beta.zip

rando_miquote FBX data from FFXIV Textools.zip

lordscales91 commented 1 year ago

Maybe the issue is within the armature itself, maybe the bones are oriented in a way that mmd_tools is not expecting. I'm not sure though, but it is possible that VMD files store the rotation of the bones relative to their local axes, rather than the world axes, therefore if the bones are oriented in a different way the rotation looks weird. You could try comparing the armature with an MMD one and see where the head and tail of every bone is placed.

wikid24 commented 1 year ago

I found the issue, it was that the FBX object's local axis was not aligned to the world's axis, where the FBX object's local axis treated Y as UP, when imported, the global axis treats Z as up.

image

To get around the issue, I needed to import the FBX object with Manual Oritentation selected as:

image

Object will come in looking like it's on it's back.

image

Then while in object mode, press CTRL+A, then apply 'Rotation', which then applied the appropriate transformations so that it treated the object's rotation as 0,0,0 to meet the global axis.

image

After applying this, it fixed it so that when applying the dancing, it treated the object properly :)

image