Animation looping

Animation looping

Anonymous
Not applicable
3,652 Views
2 Replies
Message 1 of 3

Animation looping

Anonymous
Not applicable

Hey guys!  I'm trying to do some looping animations.  For the sake of simplicity, say I'm trying to move a cube on the X axis from 0 to 5 and have that loop every 20 frames.  On frame 0 and on frame 20, the X value would be at 0, but at frame 19 the frame would be at 5.  This seems fine in Maya since playback only hits the frames on the whole number, but when I export this animation via FBX to Unity for example, the animation curve is sampled between 19 and 20 and it looks like the cube flies back to 0 from 5 really fast instead of it being a "pop" back to its original starting value.

 

1) If I clamp the key frame 19 and play the animation back slowly, the animation seems to hiccup at the end of every loop since the value stays at 5 the entirety of frame 19.

 

2) If I clamp the key at frame 19.995 (which seems to be the smallest fractional value I can put a key frame at closes to 20) then it seems much more smooth, but the animation still hiccups every once in a while.

 

3) I don't think repeating the animation curve before/after infinity will work because I need other animation on the X-axis at later points in the timeline.

 

I feel like I'm missing something simple here.  What is the way to go about creating a proper loop animation for a section of the timeline?

0 Likes
3,653 Views
2 Replies
Replies (2)
Message 2 of 3

Mickey-G
Advocate
Advocate

If I understand what you're trying to achieve I'd use the Trax Editor, have the looping motion on one layer, then the variation on another. That way you can easily loop a clip for a specific range and add variation later on without messing up the loop.

 

As for #2, In the Graph Editor you can select a key on the curves of your animation and change the tangents to step tangents, so instead of a smooth transition between two keys, you can have it jump immediately. In the attached picks I selected a key and selected step tangents and it changed how the space between the two keys is calculated (in this case it's flat and jumps to the next key). In the second pic I selected the other key and moved it to the same keyframe as the other, this way you don't need to set one to 19.9999999..... having it on the same key is fine, but you just need to move it there after the keys are set. 

 

Hope that helps!

0 Likes
Message 3 of 3

emilysherwood
Observer
Observer

I was wondering, do you know how to turn off the fractional key frames? I just want to work in integers, but every time I move my keys around, I obviously can't manually get them exactly on the line. How might I fix that? Is it a setting?

0 Likes