Fix not returning to setup pose when multiple mixing from entries end at same time

#1024
This commit is contained in:
Nathan Sweet 2017-10-28 00:18:20 +02:00
parent 980352a7ce
commit 0414803ee1

View File

@ -247,11 +247,13 @@ public class AnimationState {
if (from.mixingFrom != null) applyMixingFrom(from, skeleton, blend); if (from.mixingFrom != null) applyMixingFrom(from, skeleton, blend);
float mix; float mix;
if (to.mixDuration == 0) // Single frame mix to undo mixingFrom changes. if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.
mix = 1; mix = 1;
else { blend = MixBlend.setup;
} else {
mix = to.mixTime / to.mixDuration; mix = to.mixTime / to.mixDuration;
if (mix > 1) mix = 1; if (mix > 1) mix = 1;
if (blend != MixBlend.first) blend = from.mixBlend;
} }
Array<Event> events = mix < from.eventThreshold ? this.events : null; Array<Event> events = mix < from.eventThreshold ? this.events : null;
@ -261,7 +263,6 @@ public class AnimationState {
Object[] timelines = from.animation.timelines.items; Object[] timelines = from.animation.timelines.items;
float alphaDip = from.alpha * to.interruptAlpha, alphaMix = alphaDip * (1 - mix); float alphaDip = from.alpha * to.interruptAlpha, alphaMix = alphaDip * (1 - mix);
if (blend != MixBlend.first) blend = from.mixBlend;
if (blend == MixBlend.add) { if (blend == MixBlend.add) {
for (int i = 0; i < timelineCount; i++) for (int i = 0; i < timelineCount; i++)
((Timeline)timelines[i]).apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.out); ((Timeline)timelines[i]).apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.out);