Was wondering if we can get it in babylonjs. With the huge amounts of community made content, it could make for some interesting web apps. The MMD content tends to be shared as video on the web, having it be shared in a more interactive way would be better.
It would be amazing if we can get runtime access to the skeleton, animation, model parts, materials, etc - be able to change them dynamically
Is there some simple example code we could look at for loading a new file type into babylonjs? What would be a good first place to start? Was wondering if we can adopt what threejs has to babylonjs
I got the mmd parser running and hosted it here https://mmdtest.netlify.app/. On parsing, it gives out all the data like vertices, bones, morphs etc.
Now, I have a few things I wanted to discuss.
Once I have the data about the vertices, the next step is to create the mesh. I found this article on creating custom meshes https://doc.babylonjs.com/divingDeeper/mesh/creation/custom/custom, but the issue is that it requires us to pass a scene. I want the mesh to be standalone without passing it to any scene.
Also, I am not going to extend the scene loader for this extension. I think it would be better to keep this separate.
Hey @sebavan, that was my initial plan i.e to extend the scene loader plugin interface. But the issue is that, it essentially has three functions that needs to be implemented: importMesh, load and loadassetcontainer.
MMD is a bit different, when you load an MMD model, you generally attach a VPD(vocaloid pose data) for pose or VMD(vocaloid motion data) for animation. The mmd model file also has data for various morphs for facial expressions and other things.
For importing obj, we just pass the scene variable and the path to obj to the scene loader. But this method didn’t feel appropriate for mmd.
My plan was to build a class with a load function, which will read the mmd file and return a Babylon mesh, with rigs and skeleton when you pass the URL of the mmd file. Then you’ll have a function where you can pass the mesh and a VPD/VMD which will then assign the pose/animation to the mesh.
I am unfortunately not versed enough in the topic but I bet @Deltakosh will have some nice suggestions when he ll be back on Tuesday as he already had a look into it