# The skin of different skeleton animation from the same model is incorrect

**URL:** https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264
**Category:** Questions
**Created:** [December 9, 2024, 9:01am UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264 "2024-12-09T09:01:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![xiaopangoo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/xiaopangoo/32/23507_2.png) [@xiaopangoo](https://forum.babylonjs.com/u/xiaopangoo)
#### Post date: [December 9, 2024, 9:01am UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/1 "2024-12-09T09:01:07Z")

</div>

When I export skeleton animation from maya using the same model, first export no animation model to baylon.

> **[model\_NoAni\_2.babylon](https://drive.google.com/file/d/1GBagzP3nVzJrkorxB_NiVxc-QeDSWmba/view?usp=sharing)**
>
> Google Drive file.

Then I add two different animation to maya and export only animations to babylon.

> **[ani1\_dazhaohu.babylon](https://drive.google.com/file/d/1nX1sj1GUMfXs5h2id8Mt1i8wYPr-3Sum/view?usp=sharing)**
>
> Google Drive file.

> **[ani2\_tiaowu.babylon](https://drive.google.com/file/d/1nXqCZxUAAo4o-Rtzz8lGWq0t4T07CPE-/view?usp=sharing)**
>
> Google Drive file.

Finally I use code to combine the no animation model and two only animations. One is correct and another is incorrect.

 ![1](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/8/a87b97b23bd26d56e4d2331d6063955bf6514b50.png)  
 ![2](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/5/e5dfc9a1d2a12cf51236422456fabf7fd6f3ea02.png)

Maya files:

> **[testModel1.mb](https://drive.google.com/file/d/1CPIW_3LrFBU35jk265lLBrSZ5TYrhHok/view?usp=sharing)**
>
> Google Drive file.

> **[testModel2.mb](https://drive.google.com/file/d/12pTXp8yDdIxCz90_o-CL7w3Gs1NTvk6y/view?usp=sharing)**
>
> Google Drive file.

How to solve this problem?

---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [December 9, 2024, 9:22am UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/2 "2024-12-09T09:22:29Z")

</div>

> [@xiaopangoo](#):
>
> Finally I use code to combine the no animation model and two only animations.

How do you do this? I think we will need a repro in the Playground to be able to help.

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [December 9, 2024, 8:34pm UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/3 "2024-12-09T20:34:52Z")

</div>

cc @bghgary and @PatrickRyan

---

<div class="post-metadata">

### Author: ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)
#### Post date: [December 9, 2024, 10:57pm UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/4 "2024-12-09T22:57:35Z")

</div>

@xiaopangoo, I agree with @Evgeni_Popov… seeing how you are doing this in a playground will help us diagnose what is going on.

---

<div class="post-metadata">

### Author: ![xiaopangoo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/xiaopangoo/32/23507_2.png) [@xiaopangoo](https://forum.babylonjs.com/u/xiaopangoo)
#### Post date: [December 10, 2024, 3:17am UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/5 "2024-12-10T03:17:34Z")

</div>

The incorrect example:

> **[Babylon.js Playground](https://playground.babylonjs.com/#KBS9I5%2337312)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

The correct example:

> **[Babylon.js Playground](https://playground.babylonjs.com/#KBS9I5%2337314)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

### Author: ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)
#### Post date: [December 10, 2024, 5:04pm UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/6 "2024-12-10T17:04:14Z")

</div>

@xiaopangoo, this looks to be an issue with the joint orientations not matching between the skeletons. This is the orientation of the upper arm from the broken skeleton with Y down the bone:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/b/1be5299d143295c8435d233dfe345250d3f3d628.png)

And this is the orientation of the working skeleton with X down the bone:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/3/6341c0f052f0dd7aba128b2558a2b7c5eff718d9.png)

If you are trying to retarget animation or skeletons between meshes, the skeletons need to be identical down to the rotation of the individual joints. I hope this helps!

---

<div class="post-metadata">

### Author: ![xiaopangoo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/xiaopangoo/32/23507_2.png) [@xiaopangoo](https://forum.babylonjs.com/u/xiaopangoo)
#### Post date: [December 11, 2024, 1:06am UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/7 "2024-12-11T01:06:38Z")

</div>

This is the initial position of skeleton in maya. The orientation is different.

 ![1_skeleton](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/4/64513677232072d99bc85508f5d78222f6ccb444.png)  
 ![2_skeleton](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/c/1c029119224ceec34565d78a1c445fafd5bbd66a.png)  
 ![11_skeleton](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/d/8d310fd789574ce87aa2dae4c2b8f2c9934ca2cc.png)  
 ![12_skeleton](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/7/078122889392e4ef3259bf58f5f9d28ac7782709.png)  
Must initial position of skeleton be consistent in Maya？Or can we update the skin to the current initial position of skeleton in babylon to solve this problem?

---

<div class="post-metadata">

### Author: ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)
#### Post date: [December 11, 2024, 1:27am UTC](https://forum.babylonjs.com/t/the-skin-of-different-skeleton-animation-from-the-same-model-is-incorrect/55264/8 "2024-12-11T01:27:36Z")

</div>

@xiaopangoo, typically when you are trying to retarget animation between skeletons you want them to be identical skeletons because the bind pose and vertex weighting are integral to the deformation of the mesh. If you have differences in the skeletons in terms of number of bones or orientation of the bones in the skeleton, the bind poses will be different which will result in what you are seeing. I am not aware of a way to reconstruct the bind pose in code so that the different bone orientation could be used, but that does not mean there isn’t one. The problem becomes that every time the scene is run, this remapping will need to be done. If you move that work to the digital content creation tool (Maya, Max, Blender, etc.) then you do the rework once and there is no cost to retargeting the animations in terms of aligning skeletons.

Basically, the way I always do this is to create one skeleton that is attached to my mesh, and then for any other animation that is created, I use a copy of that skeleton as the target for the animation. This way, I will always have animations that are retargetable. In fact, keeping a biped skeleton and rig to be used by any asset you create is a good way to be able to always retarget animations.
