Skip to content

Commit f9ff6bc

Browse files
committed
Addressing Issue in Maya Rotation keyframe export, where keyframes are incorrect. modified animation keyframe export to convert from eulerAngle rotation in degrees to eulerAngle rotation in radians. Modified BabylonVector3.RotationYawPitchRollToRefBabylon docstring to clarify method.
1 parent daf7f55 commit f9ff6bc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Maya/Exporter/BabylonExporter.Animation.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,12 @@ private List<BabylonAnimation> GetAnimation(MFnTransform transform)
305305
foreach (var babylonAnimationKey in babylonAnimationKeys)
306306
{
307307
BabylonVector3 eulerAngles = BabylonVector3.FromArray(babylonAnimationKey.values);
308-
BabylonQuaternion quaternionAngles = eulerAngles.toQuaternion();
308+
BabylonVector3 eulerAnglesRadians = eulerAngles * (float)(Math.PI / 180);
309+
BabylonQuaternion quaternionAngles = eulerAnglesRadians.toQuaternion();
309310
babylonAnimationKey.values = quaternionAngles.ToArray();
310311
}
311312
}
312-
313+
313314
var keysFull = new List<BabylonAnimationKey>(babylonAnimationKeys);
314315

315316
// Optimization

SharedProjects/BabylonExport.Entities/BabylonVector3.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public BabylonQuaternion toQuaternion()
5959

6060
/**
6161
* (Copy pasted from babylon)
62-
* Sets the passed quaternion "result" from the passed float Euler angles (y, x, z).
62+
* Sets the passed quaternion "result" from the passed float Euler angles (radians) (y, x, z).
6363
*/
6464
private BabylonQuaternion RotationYawPitchRollToRefBabylon(float yaw, float pitch, float roll)
6565
{

0 commit comments

Comments
 (0)