Collada import issue

Hello,

I’m quite new to unity and I tried to import there existing collada model.
I’ve been importing without any issue the bones and skin, but i am facing issues with animations.

Whereas 90% of my frames are showing perfectly fine, few frames are acting weirds.
it seems that suddenly, some of my bones are suffering unwanted rotation over all axis.
My animations are defined using Matrix4x4 and are rendered perfectly fine with AssimpView.

By adjusting my model to “legacy” within unity 3d, i was able to browse through the frames and view the applied transforms and the math applied are kinda puzzling me.

I am having 2 frames with the following transform matrix (Y_UP):

The first frame is giving out the Euler angles in unity (x,y,z) : 0, 138.88, 0
This is correct and showing the bones fine.

For the second frame, i am expecting the same rotation, however, unity is using the following : 325.03, 203.8, 232.4
This is introducting unexpected rotation on x and z axis and messing my model.

I wrote a small program in XNA to compute euler angles out of the provided transform matrix and both gave out the expected 0, 138.xx, 0.

Therefore, I’m quite puzzled…

I bet that there is some kind of mathematical-voodoo involved there. I’ve been searching around and ended up on grimbal lock never ending discussion but it is above my level of understanding, and i’m not even sure if that’s related to my issue…

I would be delighted if someone was able to explain me my issue and eventualy some leads on how to solve them.

side note: The original model used transform matrix that i had to alter in order to obtain the proper result. I converted them from left handed using :

Thanks for your time and consideration =)

Noone got a clue ?
Or anyone know if i can find the way Unity is computing Euler angles out of transform matrix ?

Giving this thread one more last hope. I feel alike this thread needs some people’s attention.

You could try to export with separate translate/rotate/zoom (instead of backing the matrix) if the exporter allows for this, and let the unity importer calculate the matrix from those values instead?