How to add key frame for Rotation by editor script?
I need to generate some animations from my old game system to the unity animation system. I've successfully converted the position and scale frames by AnimationUtility.SetEditorCurve but I don't know how to deal with the rotation.
I tried to generate curves for m_LocalEulerAnglesRaw.[x|y|z] by it doesn't work correctly. I tried to manual add key frame by the unity animation editor and from the anmi file I found the editor add another hidden m_EulerCurves such as:
m_EulerCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 360}
outSlope: {x: 0, y: 0, z: 360}
tangentMode: 0
- time: 1
value: {x: 0, y: 0, z: 360}
inSlope: {x: 0, y: 0, z: 360}
outSlope: {x: 0, y: 0, z: 360}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
As you could see the m_EulerCurves is a vector curve. It isn't a float curve so I have no idea how to deal with it. I can't find any API or documents about this.
Please help me. Any suggestion would be appreciate.
Your answer
Follow this Question
Related Questions
Play animation controlled 0 Answers
Unity 2019 Step Key Animation Issue from Maya 0 Answers
Animation Won't Play Before My Time Freeze. 0 Answers
How can i stop my shooting animation after playing? 0 Answers
Animation for each movement direction 0 Answers