Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AnimationState] Track entries don't get cleared when TrackEntry timeScale is 0 even if mixDuration is 0. #806

Closed
pharan opened this issue Dec 15, 2016 · 1 comment
Assignees

Comments

@pharan
Copy link
Contributor

pharan commented Dec 15, 2016

http://esotericsoftware.com/forum/SkeletonAnimation-Update-Using-97-of-frame-time-7611

Track entries don't get cleared when a TrackEntry's timeScale is 0 even if mixDuration is 0.
The use case above seems to be when a TrackEntry whose animation you like to freeze in a pose is involved in mixing (ie, has a mixingFrom of its own).
This results is a crazy long mixingFrom linked list over time.

Relevant lines:
mixTime needs to be > 0 to be cleared automatically.
https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java#L134

sideeffect of the larger intention: "Only remove mixingFrom entries from the end of the list."
99ca32d

mixTime is incremented according to the timeScale of its next node
https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java#L143

@NathanSweet
Copy link
Member

The mixTime > 0 requirement ensures the mixingFrom entry is applied at least once. I've added a comment to make this clear (and next time I won't have to figure out why the heck I had it in there).

It seems an explicit check for this case is the only fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants