I think I overlooked something : could an Animation be started/stopped independently from other Animations in the same AnimationGroup ? (BTW Animation do not have OnLoop script).
Animations do have their own play/stop/etc controls, but iirc from testing, AnimationGroup controls will override them. So something like
ag_of_10:Play() -- dispatches :Play on all 10 animations
a6:Stop() -- stops the 6th animation timer, other 9 are still going
ag_of_10:Play() -- all 10 are going again
Dunno if any of the behavioral details have changed since 3.1 however.
Unrelated note: Animation and AnimationGroup were originally documented (in Zootfizzle's posting) to only have GetScript/HasScript/SetScript. The wowwiki API list is apparently just a copy&paste from his posts. Either he forgot to mention HookScript or it's been added since then; the animation objects have it just like other frames.
Well like I wrote, you could group all timers for a given addon into a single animation group. For that matter, you could recycle Animation instances for later timers; just dispatch a new :SetDuration and go.
Even dividing up animation groups per addon was just an offhand idea; a library could create a single AnimationGroup for itself and toss all the animation timers in there. Hell, a library could create a single Animation for that matter, with OnXXX code to loop over an internal list of timer expirations to fire... wait, I've just reinvented acetimers....
However do they have a :Pause() and will they also start the new animations when :Play()'ed?
I honestly do not recall if I tried that or not. It's been too long.
If an AceTimer-esque library were to be made for these, I'd imagine that the lib would make one animation group for each addon, all stored in AnimTimerFrame just because that's what it's there for. Each timer for that addon would be in that addon's animation group. So any pausing/resuming/stopping/restarting would only affect, at most, other timers already running in the same addon.
<!-- if you have logic that you want to fire once after a countdown, then add an animation to the end of this group -->
<Animation name="AutoCompleteInfoDelayer" duration="15.0" order="1">
We need the guild roster to be able to use guildies' names. But we don't want to request it on login when we're requesting everything
else from the server, so we'll wait a bit.
if ( IsInGuild() ) then
<!-- if you add another anim to this group, make sure the order is 1 so that it gets fired simultaneously with the other anims -->
I'll add for the record, since it doesn't seem to be documented explicitly anywhere on wowwiki/etc: Animations added to an AnimationGroup that's already playing do not get picked up at once. (Which makes sense.) Coders need to halt and play the group for new additions to be included.
For example, if one plans to leverage the Blizzard frames above, one can't just do
foo = AnimTimerFrameCountdownAnimGroup:CreateAnimation("Animation")
and expect foo's OnFinished to be called without restarting ATFCAG. Which seems a bit of a pain at first, but that's simply the tradeoff for not creating a bunch of redundant frames.