1
0
mirror of synced 2025-02-22 05:19:50 +01:00

Another fix for .anim with keyed frames

This commit is contained in:
KillzXGaming 2019-07-19 16:45:19 -04:00
parent c4279e6404
commit 0699a50408

View File

@ -315,6 +315,7 @@ namespace Toolbox.Library.Animations
{ {
float v = 0; float v = 0;
float scale = 1;
switch (type) switch (type)
{ {
case "translateX": case "translateX":
@ -334,7 +335,8 @@ namespace Toolbox.Library.Animations
Quaternion q = new Quaternion(rt.XROT.GetValue(key.Frame), rt.YROT.GetValue(key.Frame), rt.ZROT.GetValue(key.Frame), rt.WROT.GetValue(key.Frame)); Quaternion q = new Quaternion(rt.XROT.GetValue(key.Frame), rt.YROT.GetValue(key.Frame), rt.ZROT.GetValue(key.Frame), rt.WROT.GetValue(key.Frame));
v = quattoeul(q).X * (float)(180f / Math.PI); v = quattoeul(q).X * (float)(180f / Math.PI);
} }
break; scale = (float)(180f / Math.PI);
break;
case "rotateY": case "rotateY":
if (rt.RotType == Animation.RotationType.EULER) if (rt.RotType == Animation.RotationType.EULER)
v = key.Value * (float)(180f / Math.PI); v = key.Value * (float)(180f / Math.PI);
@ -343,6 +345,7 @@ namespace Toolbox.Library.Animations
Quaternion q = new Quaternion(rt.XROT.GetValue(key.Frame), rt.YROT.GetValue(key.Frame), rt.ZROT.GetValue(key.Frame), rt.WROT.GetValue(key.Frame)); Quaternion q = new Quaternion(rt.XROT.GetValue(key.Frame), rt.YROT.GetValue(key.Frame), rt.ZROT.GetValue(key.Frame), rt.WROT.GetValue(key.Frame));
v = quattoeul(q).Y * (float)(180f / Math.PI); v = quattoeul(q).Y * (float)(180f / Math.PI);
} }
scale = (float)(180f / Math.PI);
break; break;
case "rotateZ": case "rotateZ":
if (rt.RotType == Animation.RotationType.EULER) if (rt.RotType == Animation.RotationType.EULER)
@ -352,6 +355,7 @@ namespace Toolbox.Library.Animations
Quaternion q = new Quaternion(rt.XROT.GetValue(key.Frame), rt.YROT.GetValue(key.Frame), rt.ZROT.GetValue(key.Frame), rt.WROT.GetValue(key.Frame)); Quaternion q = new Quaternion(rt.XROT.GetValue(key.Frame), rt.YROT.GetValue(key.Frame), rt.ZROT.GetValue(key.Frame), rt.WROT.GetValue(key.Frame));
v = quattoeul(q).Z * (float)(180f / Math.PI); v = quattoeul(q).Z * (float)(180f / Math.PI);
} }
scale = (float)(180f / Math.PI);
break; break;
case "scaleX": case "scaleX":
v = key.Value; v = key.Value;
@ -364,7 +368,7 @@ namespace Toolbox.Library.Animations
break; break;
} }
file.WriteLine(" " + (key.Frame + 1) + " {0:N6} fixed fixed 1 1 0 " + key.In * (float)(180f/Math.PI) + " 1 " + key.In * (float)(180f / Math.PI) + " 1;", v); file.WriteLine(" " + (key.Frame + 1) + " {0:N6} linear linear 1 1 0 " + key.In * scale + " 1 " + (key.Out != -1 ? key.Out : key.In) * scale + " 1;", v);
} }
file.WriteLine(" }"); file.WriteLine(" }");