{"action":"created","issue":{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/621","repository_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes","labels_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/621/labels{/name}","comments_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/621/comments","events_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/621/events","html_url":"https://github.com/EsotericSoftware/spine-runtimes/issues/621","id":162390721,"number":621,"title":"AnimationState improvements","user":{"login":"NathanSweet","id":434010,"avatar_url":"https://avatars.githubusercontent.com/u/434010?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanSweet","html_url":"https://github.com/NathanSweet","followers_url":"https://api.github.com/users/NathanSweet/followers","following_url":"https://api.github.com/users/NathanSweet/following{/other_user}","gists_url":"https://api.github.com/users/NathanSweet/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanSweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanSweet/subscriptions","organizations_url":"https://api.github.com/users/NathanSweet/orgs","repos_url":"https://api.github.com/users/NathanSweet/repos","events_url":"https://api.github.com/users/NathanSweet/events{/privacy}","received_events_url":"https://api.github.com/users/NathanSweet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/labels/ready","name":"ready","color":"ededed"},{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/labels/runtimes","name":"runtimes","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"NathanSweet","id":434010,"avatar_url":"https://avatars.githubusercontent.com/u/434010?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanSweet","html_url":"https://github.com/NathanSweet","followers_url":"https://api.github.com/users/NathanSweet/followers","following_url":"https://api.github.com/users/NathanSweet/following{/other_user}","gists_url":"https://api.github.com/users/NathanSweet/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanSweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanSweet/subscriptions","organizations_url":"https://api.github.com/users/NathanSweet/orgs","repos_url":"https://api.github.com/users/NathanSweet/repos","events_url":"https://api.github.com/users/NathanSweet/events{/privacy}","received_events_url":"https://api.github.com/users/NathanSweet/received_events","type":"User","site_admin":false},"assignees":[{"login":"NathanSweet","id":434010,"avatar_url":"https://avatars.githubusercontent.com/u/434010?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanSweet","html_url":"https://github.com/NathanSweet","followers_url":"https://api.github.com/users/NathanSweet/followers","following_url":"https://api.github.com/users/NathanSweet/following{/other_user}","gists_url":"https://api.github.com/users/NathanSweet/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanSweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanSweet/subscriptions","organizations_url":"https://api.github.com/users/NathanSweet/orgs","repos_url":"https://api.github.com/users/NathanSweet/repos","events_url":"https://api.github.com/users/NathanSweet/events{/privacy}","received_events_url":"https://api.github.com/users/NathanSweet/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-06-27T07:37:53Z","updated_at":"2016-06-27T07:38:31Z","closed_at":null,"body":"_From @NathanSweet on May 7, 2016 16:14_\n\n- [ ] **1. Bug:** spine-csharp fires onComplete in update.\r\n\r\n- [ ] **2. Mix unkeyed properties to/from setup pose:**\r\n- track 0, animation 1, keys `a`\r\n- track 0, animation 2, keys `b`\r\n**Result:** `a` is left in the state it was when the animation changed, `b` snaps into position.\r\n**Expected:** `a` mixes back to the setup pose, `b` mixes from the setup pose.\r\n**Solution:** Need a TrackEntry setting for animations to mix to/from the setup pose during mixing.\r\n\r\n- [x] **3. Attachment keys on different tracks:**\r\n- track 0, animation 1, keys attachment `a`\r\n- track 1, animation 2, keys attachment `b` for the same slot\r\n**Result:** animation 1's attachment is shown if `a` key is after the `b` key.\r\n**Expected:** highest track attachment is shown.\r\n**Solution:** Don't use lastTime in AttachmentTimeline. Store attachment name for each slot to avoid excessive skin lookups, then get the attachment from the skeleton/skin lazily. If name is the same, we can't avoid the skin lookup entirely (eg the skin may have changed).\r\n\r\n- [ ] **4. Firing events during mixing:**\r\n- track 0, animation 1, keys events\r\n- track 0, animation 2\r\n**Result:** Animation 1 never fires events during mixing.\r\n**Expected:** Events for previous animation can be enabled or disabled as needed.\r\n**Solution:** TrackEntry \"event threshold\" setting for what percentage of the mix is required for events to be fired.\r\n\r\n- [ ] **5. Mix any number of animations:**\r\n- track 0, animation 1\r\n- track 0, animation 2\r\n- track 0, animation 3\r\n**Result:** With a long mix time, animation 1 disappears when animation 3 starts.\r\n**Expected:** All animations are mixed.\r\n**Solution:** Support mixing any number of animations. Mixing is [order dependent](http://esotericsoftware.com/forum/Code-HARDCORE-the-mecha-game-6553?p=30334#p30334).\r\n\r\n- [ ] **6. Mix to/from setup pose on empty track:**\r\n- track 0, run animation\r\n- track 1, aim animation\r\n**Result:** Aim animation mix starts at 1 because there is no previous animation to mix from.\r\n**Expected:** Aim animation should be mixed in.\r\n**Solution:** Currently have TrackEntry.mix but no way for it to change over time.\r\n\r\n- [x] **7. Time is lost for each animation change:** EsotericSoftware/spine-runtimes#154\r\n- track 0, animation 1\r\n- track 0, animation 2\r\n- track 0, animation 3\r\n**Result:** A small amount of time is lost at each animation change, as it takes a frame to change animations.\r\n**Expected:** Sum of elapsed time == sum of animation durations.\r\n**Solution:** Carry any leftover time from last animation to next.\r\n\r\n- [x] **8. Calling setAnimation from events crashes:**\r\n- track 0, animation 1\r\n- end: track 0, animation 2\r\n**Result:** Calling setAnimation from `end` event causes stackoverflow.\r\n**Expected:** No crash.\r\n**Solution:** Defer events so changes in callbacks can't corrupt internal state.\r\n\r\n- [ ] **9. Negative scale for flip makes for unwanted transition across zero:**\r\n- track 0, animation 1, scaleX 1\r\n- track 0, animation 2, scaleX -1.2\r\n**Result:** scaleX mixes from 1 to -1.2.\r\n**Expected:** Depending on the animation, scaleX should either transition from 1 to -1.2 or instantly flip to negative scale.\r\n**Solution:** TrackEntry setting that causes scaleX to be either -1.2 (not mix at all) or mix from -1 to -1.2 (mix but use sign from animation 2). Could also have a threshold similar to events to define at what mix percentage is the scale sign is taken from animation 2.\r\n\r\n- [ ] **10. Rotation during mix may take the wrong direction:**\r\n- track 0, animation 1, rotation 0\r\n- track 0, animation 2, rotation 170\r\n**Result:** Rotation mixes from 0 to 170.\r\n**Expected:** Depending on the skeleton, rotation may need to take the other direction, eg to avoid a shoulder rotating [unrealistically](http://n4te.com/x/168-JPfG.png).\r\n**Solution:** [Additive](http://esotericsoftware.com/forum/Code-HARDCORE-the-mecha-game-6553?p=30304#p30304) mixing would preserve the rotation directions of the animations being mixed, but has other problems such as higher tracks mixing with lower ones. Possibly we could provide an angle that rotation mixing should not cross, but this seems like a complex solution.\r\n\r\n- [x] **11. Events are not fired in order:**\r\n**Expected:** When animations are interrupted, events are not always fired in a sensible order. Eg, all events are fired after `complete`, even if some events were from the last few frames of the animation and some from the first few frames.\r\n**Solution:** Add `interrupt` event. Define and enforce the order events are fired using an event queue.\n\n_Copied from original issue: badlogic/spine-internal#49_"},"comment":{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/comments/228674097","html_url":"https://github.com/EsotericSoftware/spine-runtimes/issues/621#issuecomment-228674097","issue_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/621","id":228674097,"user":{"login":"NathanSweet","id":434010,"avatar_url":"https://avatars.githubusercontent.com/u/434010?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanSweet","html_url":"https://github.com/NathanSweet","followers_url":"https://api.github.com/users/NathanSweet/followers","following_url":"https://api.github.com/users/NathanSweet/following{/other_user}","gists_url":"https://api.github.com/users/NathanSweet/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanSweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanSweet/subscriptions","organizations_url":"https://api.github.com/users/NathanSweet/orgs","repos_url":"https://api.github.com/users/NathanSweet/repos","events_url":"https://api.github.com/users/NathanSweet/events{/privacy}","received_events_url":"https://api.github.com/users/NathanSweet/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T07:38:31Z","updated_at":"2016-06-27T07:38:31Z","body":"I believe those cases are described above.\r\n\r\nI've rewritten the cases in a better format and checked the ones that are complete in the [dev branch](https://github.com/EsotericSoftware/spine-runtimes/blob/dev/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java).\r\n\r\nTrackEntry.alpha is OK, though it breaks existing code for maybe little gain. "}}
{"actor":{"display_login":"NathanSweet"}}