During the transition between two animations(TrackEntry) in animation state a frame i skipped or rather the overshot time is disregarded.
E.g. if i first call setAnimation with an animation that has 30 frames and then add an animation that has 30 the total run time should be 2 seconds at the 30 fps that spine use.
The problem is in the update function of AnimationState where setCurrent is called in the frame when the first animation is done but the remainder of the delta time is not passed on to the next animation. So the total animation time required to complete the animation state is 2 sec + the remainder from the frame where the animations switch.
This is a problem for us since we drive the animations with a series of updates according to the number of frames in an animation state, resulting in the animation not completing.
var animationState = new spine.AnimationState(spineAnimationStateData);
animationState.setAnimationByName(0, 'animation1', false); // animation with 30 frames = 1 sec
animationState.addAnimationByName(0, 'animation2', false, 0); // animation with 30 frames = 1 sec
// very bad frame rate to more clearly show my point
for every 450 ms do
this.animationState.update(0.45);
this.animationState.apply(skeleton);
this will give the followin pattern:
ms
0 animation started
450 frame 1 of animation 1
900 frame 2 of animation 1
1350 frame 3 of animatoin 1 + current animation set to animation 2
1800 frame 1 of animation 2
2250 frame 2 of animation 2
The total needed update time for this track is 2250 no 2000