UI Animation System
Motivation
Currently, several steps are needed to create an UI animation (handle timer, add operator or modal handler that listens to timer events to update a property, adjust drawing based on animated properties, handle data for animation, ...) which means quite some work needs to be done for setting up an UI animation.
This was already done for several UI animations, resulting in unnecessary code duplication.
System implemented here
This implements a generic system that helps setting up interface animations.
Basic idea is to take a single float property (don't think other types are really needed) and update it using cubic ease in-out equations (later we can also add others if needed).
*One* operator handles all animations using this system. Timer handling, animation data handling and updating of the animated property happens automatically. Custom update callbacks with access to custom data can be defined additionally, creating high flexibility.
Basically, only setting up the animation and using the animated property to influence drawing needs to be handled manually.
To test the functionality, this patch also makes the transparent region fade in-out effect (e.g. toggling 3D View toolshelf with 'Region Overlap' enabled) use the new system.
Rationale
De-duplicates code and makes developer life easier ;)
Next steps
Steps to take this further would be:
- BPY access
- Make other UI animations use the new system
- Create more fancy UI animations!