Animating Model using MMDAnimationHelper

I am trying to achieve the physics animation of my earring model using ammojs and threejs. And base on my study I can achieve my goal using MMDAnimationHelper but the problem is I want to animate a glb file not a pmx

I studied the MMDAnimationHelper and discovered that the physics animation starts from the data under mesh.geometry.userData.MMD . I hypothesized that if I recreate this data and inject it into my GLB file under SkinnedMesh.geometry.userData.MMD , it should work as expected. However, when I attempted to run it, the outcome was not as anticipated.


Is my approach incorrect, or have I overlooked something? My suspicion is that the issue may be arising from the transformation of the parent-child relations, but I am not entirely certain. I am still in the process of searching for a solution.

Are the earrings skinnedmeshes? It almost looks like a rotated bone… so it might be a Y up conversion issue… gltf exporters convert Z to Y up on bones, whereas MMD probably doesn’t.

Yes the earring are both SkinnedMesh

regarding to the coodinate system i found out that the GLB is right-handed coordinate system with Y-up while PMX are left-handed coordinate system with Y-up, so I tried to convert the coordiate system of glb by doing after I load the model I set model scale by (1,1,-1) to flip the z-axis


What’s the userData that you’re copying over from MMD setup?

If you tried to load any pmx model that also support physics you can see this kind of data

and these are the data that I re create and tried to inject to my glb model

I’ve never used pmx or mmd before.

That userData is what I’m curious about, since it seems to duplicate the bone layout in the original model and those are the bone data that you are trying to apply to your new mesh.

I was wondering if there is some easy fixup you can do to that bone data to make it match what you’re getting from the gltf. Like swapping Y/Z somehow. because it looks like in your video the Y/Z of the bone is swapped, and that’s why the root bone is sticking sideways.

I’m just thinking out loud… .there isn’t really a whole lot to go on in your post about how/what/why we are trying to fix…?

You do have some physics working for sure… but you may need to reformat or rewrite the bone userData for it to work with that mmd stuff?

sorry for late reply and Thank you for answearing me again,

I just want to know if there’s a posible way to prevent gltf exporters convert Z to Y up on bones?

or is there posible way to undone this in threejs after it loaded programmatically?

On the blender exporter side:

You can uncheck the Y-Up.

Is that helpful?

1 Like

Actually I always check the Y-up in blender , but still the bones are the same :sweat_smile:

The y up is checked by default… i’m suggesting unchecking it to get you a skeleton possibly in z up state.