noname0310 / babylon-mmd

babylon.js mmd loader and runtime
https://noname0310.github.io/babylon-mmd/
MIT License
132 stars 7 forks source link

Whether other character models can load vmd animation format #13

Closed spencer17x closed 1 year ago

noname0310 commented 1 year ago

Because mmd models have their own bone structure, using vmd motions in other models requires retargeting, and even if retargeted, it is not possible to load a vmd model into a humanoid skeleton or something similar normally because "IK" and "append transform" do not exist in non-mmd models.

A theoretically possible way:

Loading VMD animations into other skeletons requires some understanding of the MMD runtime.

MmdRuntime.createMmdModel You must first call this method to create a Skeletal Mesh that is not an mmd model to be manipulated by the MMD Runtime. To do this, the mesh you want to load will need to be modified to follow the specifications of the MmdMesh interface.

In the process, you will need to create some metadata yourself, which is really only possible with a full understanding of the standard bone structure of modern MMD.

MmdModel.addAnimation takes a retargeting map as its second parameter, so you can utilize it to fully play the vmd animation.

noname0310 commented 1 year ago

The easiest way is to simply use a solution that converts your model to PMX format.

noname0310 commented 1 year ago

As of version 0.29.0, it is now possible to drive humanoid models into the MMD runtime.

To be precise, HumanoidMmd provides the ability to create an MmdModel from a humanoid mesh

You can check out the test code here: https://github.com/noname0310/babylon-mmd/blob/main/src/Test/Scene/humanoidMmdTestScene.ts https://github.com/noname0310/babylon-mmd/blob/main/src/Test/Scene/humanoidMmdTestScene2.ts

Documentation will be written later, so if you have any questions, please open an issue