BVH retarget next major update, support of VMD and MMD ?

Issue #2074 resolved
bouich jules created an issue

Hi Thomas!

I am currently using, Vmd Retargeting - Blender Market to import all my dance animation to the DAZ rig.

In the page they recently actually recommend to use your plugin to import genesis to blender ( which i was doing many years ago) .

However i noticed that the BVH retarget is much more complete, and way better, i wanted to know if it’s possible a support of VMD and MMD

There is literally thousands of dance animation and MMD there , i recommend writting ( motion dance mmd in youtube) and there is literally thousands of video with the motion ( VMD) to download.

So i wanted to know if it’s possible to add a VMD support to the BVH retarget, to make it fully complete and absolutely the n#1 retarget addon in the internet.

Thank you!

Comments (24)

  1. Thomas Larsson repo owner

    Unfortunately, both VMD and MMD seem to be undocumented binary formats. DAZ duf and dsf files can also be binary, but they are secretly just gzipped json files, so python’s builtin gzip and json modules can be used to bring them in. There doesn’t seem to be any free way to load VMD or MMD into Blender, and without that I am lost. The only thing I found was Butaixianran’s add-on, but you already have that.

  2. bouich jules reporter

    Once you download the plugin for blender 3.6, import the MMD , then import the VMD to the character by clicking on it.

  3. bouich jules reporter

    Please feel free to close this as invalid again, if it’s not worth.

    Thank you!!

  4. Alessandro Padovani

    I believe what Thomas could do is to provide a retarget from MMD to genesis, after you load the MMD figure in blender. That means “retarget selected to active“ may add support for MMD armatures, provided MMD defines a standard armature which doesn’t vary with the figure. But since there’s already an addon which loads the MMD file directly to genesis, that is easier to use.

    p.s. Unless MMD can export to fbx or bvh, in that case you could provide a test file for that.

  5. Thomas Larsson repo owner

    I had a look at this, but it is a challenge that will take some time to fix. As Alessandro said, the idea is to import the MMD figure and animation with the free tool, and then retarget selected to active. But there are three problems:

    1. Japanese bone names, so we need to add unicode support. Fixed.
    2. The legs are controlled with IK. The plugin could recognize that and bake the animation to the FK legs before retargeting.
    3. Something is seriously wrong with the upper arm.

    Although the result is absolutely horrible, I upload the latest commit, mainly to make sure that Bitbucket doesn’t do anything funny with unicode files.

  6. Thomas Larsson repo owner

    After uploading I see that Bitbucket treats UTF-16 (the MMD rig definition) as a binary file. Let me know if this causes problems.

  7. bouich jules reporter

    wow excellent import the MMD and VMD to blender.

    retarget with BVH and enjoy the thousands or even hundred of thousands of mmd dance animation out there to our DAZ character for free.

    Thank you Thomas! it worked great! even the finger tracking is perfect.

  8. Thomas Larsson repo owner
    • changed status to open

    Sorry, but this is not resolved at all.The plugin recognizes the bones, but the animation is not retargeted correctly, and the problem with the IK legs remains.

  9. bouich jules reporter

    Oh thank you! actually I did try only a quick animation with hands and fingers seemed to be correct.

    will try more advanced animation this Sunday.

  10. AB

    Regarding a temporary workaround is to use the existing VMD → DAZ rig plug-in, then export said animation as a bvh then subsequently retarget it as usual. However, the VMD → DAZ process isn’t perfect and subsequent conversions compounds the errors, especially as MMD models are finicky with the use of JP bone names as well as a lot of non-standard bones, and, imo, a bit of an abnormal behaviour with the bones as pointed out by Thomas.

  11. Thomas Larsson repo owner

    Retargeting of VMD seems to work now, both with the original Japanese bone names and if you rename bones to English with the internal directory when loading the pmx file.

    There were some problems that don’t appear when you import animations directly from bvh or fbx files:

    Some of the mmd bones are connected. The plugin rescales the source bones to match the size of the target rig, but this doesn’t work with connected bones. The fix was to disconnect all bones in the source rig before rescaling them.

    The mmd legs have ik constraints. There was already a tool that mutes all ik constraints and bakes the animation to the fk bones, but it was located in the rig_daz repo. I moved it to the bvh retargeter and modified it slightly. In particular, limit rotation constraints are also muted because the mmd shins have a strange constraints that messes up things when ik is disabled.

    There are two new buttons in the main panel, Mute IK Constraints and Unmute IK Constraints. However, you don’t need to use them because the plugin automatically detects ik constraints and mutes them before retargeting.

  12. Alessandro Padovani

    If fk and deform bones are the same, you should be able to use the blender baking tools: object > animation > bake action, no need for custom baking.

  13. Thomas Larsson repo owner

    Yes, it should work, although using operators is context dependent which may complicate things. However, the legs dont move much in the attached examples, so it is hard to see a difference. I will make some clearer examples to see what works best.

  14. bouich jules reporter

    did some extensive test! i can confirm its working great!

    feel free to close.

    And thank you again for the excellent work!

  15. Alessandro Padovani

    bvh 4.1.0046

    I did a quick test too and seems to work fine. I used the standard figures in MMD and some vmd animations I found around. For long animations it is very slow to retarget. To install MMD and extract the vmd animations I had to change the system locale to japanese, otherwise the zip file names were not readable, as well as the japanese txt files.

    https://sites.google.com/view/evpvp/

    https://bowlroll.net/file/12486

    https://ux.getuploader.com/donburi_mmd/download/11/acerola_taiso_set.zip

  16. Log in to comment