I still have the same problem even though I updated the latest runtime.
My situation is that I have two animations, guard and idle. At the beginning of the guard animation, I make a shield image visible in Spine and when there is animation changing, I make the shield image invisible by programming by setting null to the shield image attachment with Spine runtime.
Here is my code simplified version:
// set the guard animation
animationState.setAnimation(0, "guard", loop);
// some time later...
skeleton.findSlot("guard-shield").setAttachment(null);
// then change to idle immediately
animationState.setAnimation(0, "idle", loop);
// then update the animation
animationState.update(delta);
animationState.apply(skeleton); // this line makes "guard-shield" on, but I don't want it to be so...
So, I reverted to the old code in the animation.java file which works fine.
public void apply (Skeleton skeleton, float lastTime, float time, Array<Event> events, float alpha) {
float[] frames = this.frames;
if (time < frames[0]) {
if (lastTime > time) apply(skeleton, lastTime, Integer.MAX_VALUE, null, 0);
return;
} else if (lastTime > time) //
lastTime = -1;
int frame = (time >= frames[frames.length - 1] ? frames.length : binarySearch(frames, time)) - 1;
if (frames[frame] < lastTime) return;
String attachmentName = attachmentNames[frame];
skeleton.slots.get(slotIndex)
.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName));
}
For my project this works ok, but isn't it good?