为什么Maya中的动画旋转值和Unity中的不一样?

Why are the animation rotation value in Maya different from that in Unity?

我有一个包含动画的 FBX 文件。当我将其导入 Maya(2017) 时,骨骼 'arm_r_shoulder' 的旋转值如下所示:

但是导入到Unity(5.6.1f1)后值发生了变化:

可以下载 fbx here

我的问题是,为什么这些值不同?我应该如何处理?

我想这是 Rotate Order and/or Order of Transformation 的问题。首先,在 Maya 中检查 Rotate Order,然后在 Unity 中检查。此参数在两个包中必须相同。

您可以使用以下代码行更改 Rotate Order 但在 Maya 中保留整体变换:

import maya.cmds as cmds
cmds.xform(preserve=True, rotateOrder='yzx')

此外,还有欧拉旋转与四元数旋转方案:

import maya.cmds as cmds
cmds.rotationInterpolation('polyModel_rotateY', convert='quaternion')

阅读此 post 了解如何使用 Python 进行转换:Quaternion to Euler Rotations