SpriterDotNet
SpriterDotNet copied to clipboard
Advanced blending features
Is it possible to implement a feature that lets you blend together more than two animations?
What about a feature that blends a new animation into the current one?
Blending multiple animations should not be complicated - I'll change the title of this issue and leave it as a to-do task.
Isn't blending a new animation into the current one the same as blending any two animations? If not - what's the difference?
Well as it stands now, you have to know the names of both animations you want to blend, and they together become the new animation.
For example, you want to make a character blink once, but you want to do this regardless of whether the character is standing, walking or otherwise.
Ah, ok, I understand. So it's something like blend animation X into the current one with a certain weight factor until animation X finishes and then continue playing current one?
That and similar scenarios, yes.
OK, I'll try to do this in a generic way that covers all the common scenarios and allows the users to create their own.
Probably I'll introduce a separate object with the blend info about all animations involved, methods that get called every frame to allow adjusting the blend factor(s) and callbacks for certain events (like animation finished).
That would be cool. It'll go a long way in either implementing things like blend trees, or if Unity blend trees aren't directly possible (due to AnimatorController being horrifyingly difficult to tinker with), a different implementation that achieves the same effect.
Just to complicate things further:
Transitioning from one blended state to another blended state. As well as transitioning only part of a blended state while leaving the other part of the state as is.