Monday, April 1, 2013

Animation loops the hard way or is there a better way?

One thing that sometimes seems to be tedious is to make an animation to loop seamlessly without jumps, and all animation packages I saw till today do not provide a way to to do this, the reason can be obvious if you are just making straight animations, but when making games an essential component is to loop for example an idle animation and have each channel behave as expected regardless of the starting frame without having to worry about the start or end of the animation loop, anyway it can start at any frame if you are in a loop and it should look as expected.

Since I couldn't find any reasonable tool for that, I ended up doing it to simplify simple looping tasks, like moving legs, arms, etc... in loops , Check a quick test here. Nothing really revolutionary to see here, but it just broke down a tedious task to the minimum, by only having a keyframe at the beginning and one in the middle the framework takes care of compensating and returning back to the loop properly without having to do it myself manually, and one of the key issues I had for many months when trying to animate simple loops was that all loops had to start at frame 0, and put my keys after, with this solution I just end up putting keyframes at any time and the framework will close the loop without me having to adjust it to look proper. This simple logic actually made me save quite a lot of time at the end, each animation has multiple parts moving and I am not showing up at this stage what the vertex animation holds, so trying to loop seamlessly all the keys and look proper was a tedious task, for example, for one of the characters it took me about 10 hours to make it look right, only because the looping started always at frame 0, ended at the end of the animation length and have so many moving parts that it was really hard to make it look convincing. Now it can easily take me half of that just by using a free mode where loops are calculated by the framework and not by my eyes. I am still wondering why there aren't any tools like that in animation packages, probably because the target audience is not games and just movies, or perhaps I haven't search enough.


2 comments:

  1. one work around is the Lerp, or linear interpolation. It is how a lot of animators (especially in 3D)for games can *smoothly transition from any animation to another*. An elegant solution is to just take the "bones" and lerp them to the start of the next animation in like oh .3 seconds, and make it look nice.
    Because this method is so common, most programs already have it inside a good program. EG. It is taken for granted.

    ReplyDelete
  2. true! but my problem is a little bit different, you can loop manually by using Lerp, but I was looking for a way for the framework to loop my animations without me having to manually loop them when using keyframes, most tools will force you to actually create the necessary keyframes to loop the animation which is not good at all. I wasn't looking for smooth transitions at this time since the problem is that I am working on 2D using 3D so not all frames do have the same number of vertices which is very tricky so you can't assume your bones will Lerp seamlessly. So one of the main uses for this tool is for doing cloth animation without bones and that can be loopeabke and still use physics calculation when required, in this case you don't have bones and the loop is managed by the framework.

    ReplyDelete