- Home /
Question by
sark12500 · May 25, 2012 at 06:00 AM ·
animationcurvekeyframe
get key in animation curve
I try to get key in animation curve.
AnimationClipCurveData[] animationCurveData = AnimationUtility.GetAllCurves( m_animationClip , true );
for( int ii = 0 ; ii < m_checkArray.Length ; ii ++ )
{
if( m_checkArray[ ii ] )
{
foreach( AnimationClipCurveData x in animationCurveData )
{
if( x.propertyName == "m_LocalEulerAnglesHint.x" )//m_LocalRotaion.x
{
Debug.Log( x.curve.keys.Length );
for( int jj = 0 ; jj < x.curve.keys.Length ; jj ++ )
{
Debug.Log( x.curve.keys[ jj ].time );
Debug.Log( x.curve.keys[ jj ].value );
}
}
}
}
I want set the rotation angle. so I show the log about key. but the number of key( array ) is inconsistent with I saw in the Animation window. How can I get the key and set it by script.
Comment
Your answer
Follow this Question
Related Questions
How can I set the tangents of Keyframes in an AnimationCurve through scripting? 1 Answer
Tangents ignored while setting keyframes 1 Answer
key count: 1 on curve 'curvename' error 1 Answer
How can I make an animation curve Keyframe "Auto" in code? 3 Answers
Accessing Animation Curves/Keyframes during runtime 1 Answer