Action layers - blending out

I’ve got a question about the action layer system. When I play more than one action simultaneously on different layers, using blendin works fine at the beginning of an action, but is no good when the action on top ends and the action underneath resumes - it jerks back to the other action.

For example, when a character is running and he starts an attack animation on a new layer with a blendin of 5, he transitions smoothly from running to attacking, but as soon as the attacking is over, there is no transition at all back to just running. This seems like a drawback to the current layered action system, but I don’t know.

Is there a workaround that would enable blending both in and out of layered actions? Or would this be something to suggest as a future feature for the BGE?

One problem with a blendout, is how do you do it? For blending in, it’s rather simple, you take the initial pose, then blend each successive pose with that initial pose with diminishing weights. To do the same with blendout, you’d need to know what the final pose would look like. You could use the initial pose again, which could lessen the popping, but it’s still rather jerky. Here is an example of using the initial pose:

I see. That seems to be a decent workaround. But since there are two actions playing at the same time on different layers, couldn’t you just gradually diminish the influence of the top action until the action underneath takes over?

I’m not sure how this would be done with Python, though…

That seems to make sense… Did you just keep calling playAction every frame during the fade-out with diminishing weight until it was done fading out?

EDIT: Okay, I tried doing that, and it worked perfectly! Even though it’s a bit of a hassle. Thanks for your help, guys.