[SoC 2009 - Submitted] High-Level Animation System

Threads related to Google Summer of Code
Post Reply
LostEra
Google Summer of Code Student
Google Summer of Code Student
Posts: 56
Joined: Wed Jun 07, 2006 8:33 pm
x 1

[SoC 2009 - Submitted] High-Level Animation System

Post by LostEra »

I have submitted the following SoC application. Please let me know if you have any questions or suggestions.

Background

To maintain a level of realism in animation, it is necessary to blend in and out of animations, possibly while still animating. This is necessary to avoid animation "popping", but the details of such an implementation are not generally of interest to a developer, and if they are, classes may be overridden to accommodate extensions to the system. Such a system does, however, need to be capable of handling a variety of circumstances, including the case of multiple active animations, for example, swinging a sword while running. It should also be easy for a developer to queue up animations without handling the timing explicitly. If a character has a landing animation after a large fall, but the player begins running immediately after the fall, the landing animation should not be skipped. Still, it is also often necessary to interrupt the queue. If the player hits the ground while multiple animations are queued up, the landing animation should nevertheless begin blending in.

Proposal

I propose to solve these issues with a high-level, extensible animation system built on top of the existing, lower-level OGRE animation system. No modification should be necessary to the current, relatively low-level animation system (AnimationState, Skeleton, etc..) for these features. Instead, additional classes relating to the high-level system will be added. The proposed system will also simplify the process of utilizing the animation blend masks exposed by the lower-level system.

Additionally, the integration of an animation listener interface similar to listeners available in other parts of the engine would allow for synchronization with and control over the animations as they are run.

Project Components
  • AnimationTransition: This class controls the animation transition in and out of an AnimationState. Optionally, it may include an AnimationChannel name (see AnimationChannel) and interrupt flag. The default implementation will include a transition duration and flags to control animation while blending in and out, but other methods may be implemented. As part of the project, I would like to implement some of the more common transitions, hopefully at community request.
  • AnimationBlender: This class should be created for each entity requiring high-level animation. It will contain a collection of named animation channels. Transitions to animations will be achieved by calling a method (possibly named "transition") accepting an AnimationTransition and an optional interrupt flag. Upon receiving a transition request, it will be forwarded to an appropriate AnimationChannel, or a new channel may be created to accommodate it. This class will also include an "addTime" or similar method to control animation.
  • AnimationChannel: This class stores and manages a queue of AnimationTransitions. It will notify each transition when it is blending in, when it is waiting for the next animation, and when it is blending out. Optionally, a blend mask may be specified for each channel. It will also be possible to determine if the animation queue is empty to accommodate "idle" animations"
  • AnimationListener: This class would allow for "listening" to changes within an individual animation, including advancing key frames. This would allow synchronization and possibly control over an animation as it is run.
Deliverables

Implementation of listed components in C++ and following OGRE coding guidelines
Implementation of multiple animation transitions including those requested by the community
Doxygen code documentation

Schedule

4/20-5/23: Get to know my mentor and the internal workings of the animation system. Discuss with community what types of transitions would be most beneficial, although this process should continue as the system becomes further defined.
5/23-6/6: Integrate AnimationListener functionality.
6/6-6/22: Create AnimationBlender, AnimationChannel, and AnimationTransition classes.
6/22-6/29: Complete default animation transition and test system up to this point.
6/29-7/6: Communicate changes to OGRE community and request input.
6/6-6/13: Complete animation transition with support for blend masks to simplify this functionality.
6/13-6/24: Implement alternative animation transitions including those requested by the community.
7/24-7/31: Complete example of using the system, including the use of multiple animation transition implementations.
7/31-8/7: Implement additional alternative animation transitions including those requested by the community and final refinement of interface.
8/7-8/17: Develop and implement final testing and make corrections for any identified problems. Communicate changes to OGRE community and request input. Clean up code and finalize documentation.

Schedule Note: Although time was explicitly allocated for additional animation transitions, these may also be implemented sooner in order to help finalize the interface early in the process. If the task of creating new transitions is completed earlier than expected, additional work on the animation system may be completed.

Anticipated Issues

Handling blend masks for per-bone weights.
Making the AnimationTransition interface generic enough to accommodate a wide range of usage scenarios.

Future Extensions

More animation transitions can easily be added as the need for them becomes apparent. Additionally, if the interface is generic enough, animation transitions for other animations methods, like IK, might be possible.


Edited April 1st to reflect proposal changes.
Edited April 9th to provide more detail regarding blend mask support.
Last edited by LostEra on Thu Apr 09, 2009 6:00 am, edited 3 times in total.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by xavier »

Have you looked at the Tecnofreak animation system and editor? Search here in the forums for more.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
LostEra
Google Summer of Code Student
Google Summer of Code Student
Posts: 56
Joined: Wed Jun 07, 2006 8:33 pm
x 1

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by LostEra »

The Tecnofreak animation system does look very nice, particularly the editor. However, my project was intended to be a smaller, lightweight solution built into Ogre. I would very much like some opinions about whether there is sufficient interest to warrant such a system, or if I should submit a new proposal.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by tuan kuranes »

You might check last year gsoc about animation so that you build any proposal upon it, as for now it does conflict with you proposal.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by sinbad »

Last year's animation proposal was quite ambitious, and although it produced some academically interesting results that should be examined in any future work, in the end it didn't really result in a production-ready component. I think that a simpler project concentrating on something that is practically useful in more projects would be valuable. The kind of things I'd be looking for would be:

- Stateful animation transition management (which is what you've mainly covered)
- Helpers for mixing animations targetting subsections of the skeleton (blend masks)
- Support for supplementing the animation data with external, potentially non-visual information, such as triggering events when passing certain keyframes (think footstep sounds)
- Hooks for manual control of bones & IK

There isn't time to cover all of these things in the summer, but I think there's probably room to pick off one more in addition to the stateful transitions. What are your thoughts on that?
LostEra
Google Summer of Code Student
Google Summer of Code Student
Posts: 56
Joined: Wed Jun 07, 2006 8:33 pm
x 1

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by LostEra »

@Tuan Kuranes
I looked at the animation SoC project from last year, but at least according the wiki, the animation system portion was not completed. I assumed this was why the feature remained on the "Help Requested" wiki page. Please correct me if I am mistaken as I know you mentored the project.

@Sinbad
I'm glad to hear there is still interest in such a feature. After reading Xavier's post, I began preparing to write a proposal on Unit Testing. Although I thought it would be an interesting project that I might like to work on in the future, I am relieved that I don't need to try to submit another application in the next 2 days.

Thank you also for suggesting some more potential aspects to the project. I like the idea of making the blend masks simpler to use as it fits in nicely with the idea of making a higher-level animation system. I also would like to pursue support for supplementing animation with external information, potentially through a listener interface. I will add these to my proposal shortly.
westine
Google Summer of Code Student
Google Summer of Code Student
Posts: 62
Joined: Sun Apr 01, 2007 12:12 pm

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by westine »

I'm the last year's animation system student. I'd like you are also interested in animation. My last year's animation of motion graph is probably OK, what needed is the skeleton rematching and transition enhancement.
LostEra
Google Summer of Code Student
Google Summer of Code Student
Posts: 56
Joined: Wed Jun 07, 2006 8:33 pm
x 1

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by LostEra »

Thank you for correcting me on that. It appears I should have a closer look at the work you did last summer.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by sinbad »

Just a reminder that you only have the rest of this week if you want to elaborate on your application.
LostEra
Google Summer of Code Student
Google Summer of Code Student
Posts: 56
Joined: Wed Jun 07, 2006 8:33 pm
x 1

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by LostEra »

I had not planned any changes to my proposal beyond those I made at your suggestion on April 1st regarding the animation listener and blend mask helpers. If anything is unclear or needs further work, I would be more than happy to make the necessary changes.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by sinbad »

Ok, I just wondered if you were going to follow up your 3rd April comment regarding last year's work, and whether you were going to elaborate more on the blend masks support. I didn't see much in the proposal about either (only a very cursory mention of blend masks) so thought you were still thinking about it.
LostEra
Google Summer of Code Student
Google Summer of Code Student
Posts: 56
Joined: Wed Jun 07, 2006 8:33 pm
x 1

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by LostEra »

I've had a more thorough look at the motion graph work from last summer, but I do not believe it is suitable as a platform upon which to build this project. That said, some portions of the design could be incorporated into this project. For instance, the use of triggers to signal transitions.

I have also been thinking about simplifying the use of blend masks and believe that in addition to a transition implementation to accomodate blend masks, each channel should also optionally include a blend mask applied to each state animated through it. In cases where multiple channels use the same animation state, the blend masks would be added up and clamped to one. I have edited my proposal a bit to indicate this change.
westine
Google Summer of Code Student
Google Summer of Code Student
Posts: 62
Joined: Sun Apr 01, 2007 12:12 pm

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by westine »

I have contacted with the author of Tecnofreak, the system's thought is very simple -- a multiple layered blender.

And I have also reviewed your proposal, Although I'm a student myself, I am glad to give my suggestion should that can improve Ogre's animation.

First, how will your AnimationTransition do the transition?
In my proposal and my current work, I do it using sth like Register-Curvehttp://pages.cs.wisc.edu/~kovar/project ... n%20Curves,
it is simple like stepping timing by postures. Keep in mind, walk and run is speed different, you should adjust the frame rate to transition, so there is no unnatural effect.

Second, could you please make AnimationChannel and AnimationListener clearer?
I think you maybe want to have a Trigger schema and a TickAnim function. This is very straightforward, just add delatsecond Parameter from global timer in Ogre to
each functions you want to advance and trigger structure as well.

Hope it helpful.
Anyway, whatever we should help each other to enhance animation system as possible as we can.
LostEra
Google Summer of Code Student
Google Summer of Code Student
Posts: 56
Joined: Wed Jun 07, 2006 8:33 pm
x 1

Re: [SoC 2009 - Submitted] High-Level Animation System

Post by LostEra »

Tecnofreak's multilayered blender concept may be simple as you say, but his implementation is quite extensive. To see what I mean, check out his project on SourceForge: http://sourceforge.net/projects/tecnofreakanima

My AnimationTransition will itself be an abstract class. Individual implementations of this class are free to perform blending in whatever manner is most suitable to the application. It may even be possible to implement animation constraints using such an interface, but this is probably a task best suited to a lower-level system. I will provide multiple implementations to provide a variety of out-of-the-box functionality.

To clarify, AnimationChannel is basically a "queue" of animations to be displayed. AnimationChannels will be blended together to form the final pose. Indeed, it will respond to triggers and have a "TickAnim" function of sorts, but named "addTime" to maintain consistency with the rest of the Ogre animation system.

AnimationListener will be a mostly separate, but related, project. It will allow the user to recieve notification when certain events occur within the low-level animation system. This would allow, for instance, footstep sounds to be syncronized with the animation, to use Sinbad's example.

Thank you for your helpful suggestions. I would like to offer a bit of advice to you as well. In looking through your code from last year and your diagrams this year, I noticed that sometimes your names do not conform to Ogre guidelines. I think that this simple change might help lower the communication barrier. The official guidelines are available here: http://www.ogre3d.org/forums/viewtopic.php?f=4&t=5818

I hope I have adequately addressed your questions. If not, please let me know. Good Luck!
Post Reply