bug report: Actor.stop('animName')

One of my teammates has identified what he believes to be a bug in the Actor animation system.

Assume we have an Actor model of Birdman, and his animations are ‘get_coffee’ and ‘eat_scrambled_eggs’. If the ‘get_coffee’ animation is playing, and we call

birdman.stop('eat_scrambled_eggs')

then it will stop the coffee animation. This behavior seems inconsistent with the documentation, which would suggest that he should continue to get coffee.

We’re not doing any animation blending in this case; it is simply trying to stop an animation that happens not to be the currently-playing one. The same behavior shows up when calling with the parameter name,

birdman.stop(animName='eat_scrambled_eggs')

I understand. It does seem a little unexpected, but it’s not a bug; and the behavior is internally consistent.

When the Actor is in blend mode (that is, actor.enableBlend() has been called), then it will behave in way you expect with multiple animations: stopping ‘get_scambled_eggs’ will have no effect on ‘get_coffee’.

However, when an Actor is not in blend mode, it follows a simple rule: whatever animation you last operate on is always the “current” animation, and all other animations are implicitly stopped. Therefore, when you call stop(‘get_scrambled_eggs’), you make that animation the current one, implicitly stopping ‘get_coffee’. Then, of course, the Actor realizes that ‘get_scrambled_eggs’ is already stopped, so that call is otherwise a no-op, other than the change of the current animation.

Note that the manual says only, “When you call stop() in blend mode, you can stop a particular animation by name,” so this behavior is not technically in contradiction to the manual–the manual doesn’t really say what happens when you stop an animation by name and you are not in blend mode. I agree it should clarify this point; I will make this change to the manual.

David