Looking for an example where a mixamorig model has animations applied to it from any other mixamorig animation

So i want to be able to share animation clips with loads of different models

How can I achieve this?

Applying animation clips from one model to another using the following way does not work as it looks like differences in bone lengths or scales affects the result and does not look correct at all

   const group2 = group.clone( anim, (target) => {
        const idx = skeleton.getBoneIndexByName(target.name)
        const bo = skeleton.bones[idx];
        return bo.getTransformNode();
   })

Is there a way for complete retargeting with babylonjs?

Hello! I think that if the skeletons are different, retargeting is not going to be a simple task. It would be better to first ensure the models all have the same skeleton. @bghgary any thoughts?

1 Like

I’m not sure I have much to add. If you have exactly the same skeleton, it is easy, but otherwise, the math is complicated.

The skeleton is the same

The point is to be able to retarget from the same skeleton

If two models have the same rig but different scales/lengths and mesh surfaces, and I should be able to apply the same animation clip to both models. I should be able to apply the animation to any rig thats the same.
Currently that doesnt work

I don’t mean just that the skeleton has the same structure. I mean the skeleton has the same structure and bone matrices.

Maybe this thread will help: Issue loading/retargeting animations - Questions - Babylon.js (babylonjs.com)

If you have a playground with a repro, I can take a look to see.

Hello @bozworth just checking in if you are able to provide us with a playground so we can take a look :slight_smile:

1 Like

Hello, I have an example here that needs to solve the problem of different bone coordinates causing deformation during animation playback. Can you help me take a look

Hello, I have an example here. Can you help me take a look

You can do it this way:

3 Likes

Your plan is also acceptable, as I wrote it https://playground.babylonjs.com/#8LFTCH#2463 This example has a similar effect, but now the skinning is not correct. I handled the position and rotation Quaternion on my end, which caused the animation to be incorrect. Now it’s just that the skinning is still the problem. Do you have any other solutions?

What’s wrong with my PG? I think the skinning is ok, the animation for the guy is exactly the same than for the model, contrary to your other PG(?)

2 Likes

If you remove the key frames in my PG and modify the animation, you will find that it has the same effect as yours. The problem now is that you remove the skin and take a look. The root bone is reversed by 90 degrees and the neck bone is separated, which is why I modified the key frames, causing the animation to distort. The problem now is that the animation has a problem after fixing the bones, not returning to the beginning. I hope you can take a look again. Thank you very much for your help

1 Like

I tried with some other code I had for retargeting animations:

However, the result is much like yours, so I would not know how to do it, unfortunately.

1 Like

Thank you very much for your help. I have been working with my colleagues on this issue for the past few days and it finally looks perfect. I have made some revisions, but there may still be a slight difference

2 Likes