Re: [web-animations] Bubble animation events to effects

I hit another obstacle, but while trying to solve it, I think I gained new insight on how to solve the effect management problem.

The obstacle is pretty straightforward: when multiple effects are nested, I need some of them to fill until the end the active phase of the root effect, while others indefinitely. This means I can't clip them in the root effec, and I need to change some effects' fill modes when the root effect is about to enter after phase. And I come up with a solution like this:

Each effect should accept optional callbacks named before and after. When being nested, a parent effect can decide if it wants to handle the callbacks. If not, these callbacks are delegated to its parents and so on. If so, it arranges its child effects such that the before and after callbacks of each child effect are placed in zero-duration, forwards-filled custom effects. The callbacks are called when the custom effects have a time fraction of zero, and these custom effects are prepend and append to the parent effect respectively. The root effect always handles these callbacks, including its own callbacks. If an effect decides to handle these callback, it in effect "clips" these callbacks into its active phrase. Callbacks specified in group/sequence effects are handled by their ancestors, if there is one.

I think this design gives nested effects more controls on how they can affect the whole sequence of animation, and it shouldn't have the sync problem as the events method does, and it should solve all the management problem I currently raised.

Would like to hear your thoughts. Thanks. 

Received on Sunday, 31 May 2015 01:15:22 UTC