{"action":"created","issue":{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/1503","repository_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes","labels_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/1503/labels{/name}","comments_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/1503/comments","events_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/1503/events","html_url":"https://github.com/EsotericSoftware/spine-runtimes/issues/1503","id":496618959,"node_id":"MDU6SXNzdWU0OTY2MTg5NTk=","number":1503,"title":"[spine-ts] \"default\" skin backwards compatibility is broken.","user":{"login":"Jonchun","id":5800539,"node_id":"MDQ6VXNlcjU4MDA1Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5800539?v=4","gravatar_id":"","url":"https://api.github.com/users/Jonchun","html_url":"https://github.com/Jonchun","followers_url":"https://api.github.com/users/Jonchun/followers","following_url":"https://api.github.com/users/Jonchun/following{/other_user}","gists_url":"https://api.github.com/users/Jonchun/gists{/gist_id}","starred_url":"https://api.github.com/users/Jonchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jonchun/subscriptions","organizations_url":"https://api.github.com/users/Jonchun/orgs","repos_url":"https://api.github.com/users/Jonchun/repos","events_url":"https://api.github.com/users/Jonchun/events{/privacy}","received_events_url":"https://api.github.com/users/Jonchun/received_events","type":"User","site_admin":false},"labels":[{"id":1296560320,"node_id":"MDU6TGFiZWwxMjk2NTYwMzIw","url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/labels/bug","name":"bug","color":"cb2431","default":true}],"state":"closed","locked":false,"assignee":{"login":"badlogic","id":514052,"node_id":"MDQ6VXNlcjUxNDA1Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/514052?v=4","gravatar_id":"","url":"https://api.github.com/users/badlogic","html_url":"https://github.com/badlogic","followers_url":"https://api.github.com/users/badlogic/followers","following_url":"https://api.github.com/users/badlogic/following{/other_user}","gists_url":"https://api.github.com/users/badlogic/gists{/gist_id}","starred_url":"https://api.github.com/users/badlogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badlogic/subscriptions","organizations_url":"https://api.github.com/users/badlogic/orgs","repos_url":"https://api.github.com/users/badlogic/repos","events_url":"https://api.github.com/users/badlogic/events{/privacy}","received_events_url":"https://api.github.com/users/badlogic/received_events","type":"User","site_admin":false},"assignees":[{"login":"badlogic","id":514052,"node_id":"MDQ6VXNlcjUxNDA1Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/514052?v=4","gravatar_id":"","url":"https://api.github.com/users/badlogic","html_url":"https://github.com/badlogic","followers_url":"https://api.github.com/users/badlogic/followers","following_url":"https://api.github.com/users/badlogic/following{/other_user}","gists_url":"https://api.github.com/users/badlogic/gists{/gist_id}","starred_url":"https://api.github.com/users/badlogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badlogic/subscriptions","organizations_url":"https://api.github.com/users/badlogic/orgs","repos_url":"https://api.github.com/users/badlogic/repos","events_url":"https://api.github.com/users/badlogic/events{/privacy}","received_events_url":"https://api.github.com/users/badlogic/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2019-09-21T06:10:43Z","updated_at":"2019-09-23T13:16:45Z","closed_at":"2019-09-23T13:06:22Z","author_association":"NONE","body":"This was code that used to return a Skin object. \r\n`skeletonData.findSkin(\"default\");`\r\n\r\nmaking the following snippet valid:\r\n`skeleton.setSkinByName(\"default\");`\r\n\r\nHowever, with the changes in the new export format, it looks like the skin \"default\" is no longer included, meaning there is no more empty \"default\" skin, so code such as `skeleton.setSkinByName(\"default\");`\r\nwill error out saying `Skin not found: default`\r\n\r\n(I've only checked the JSON export formats, but the code in `SkeletonBinary` reads like it would have the same problem to me.)\r\n\r\nIn my case, I came across this issue as I'm trying to update the Phaser Spine plugin:\r\nhttps://github.com/photonstorm/phaser/blob/v3.19.0/plugins/spine/src/gameobject/SpineGameObject.js#L517\r\nand update it for use with spine3.8 runtime. I'm sure that there are other developers who are also using `setSkinByName(\"default\")` in their code. \r\n\r\nI've fixed this issue for myself by adding a check at the end of the skin loading loops in both `SkeletonJson.ts` and `SkeletonBinary.ts`.\r\n\r\ne.g. inserted into line 261 in `SkeletonJson.ts` \r\n```\r\nif (skeletonData.defaultSkin == null) {\r\n\tskeletonData.defaultSkin = new Skin(\"default\");\r\n\tskeletonData.skins.push(skeletonData.defaultSkin);\r\n}\r\n```\r\nIf the design change to return `null` for an empty default skin was intentional, this issue should be dismissed. However, it might be nice to provide a marginal amount of backwards compatibility."},"comment":{"url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/comments/534094176","html_url":"https://github.com/EsotericSoftware/spine-runtimes/issues/1503#issuecomment-534094176","issue_url":"https://api.github.com/repos/EsotericSoftware/spine-runtimes/issues/1503","id":534094176,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNDA5NDE3Ng==","user":{"login":"Jonchun","id":5800539,"node_id":"MDQ6VXNlcjU4MDA1Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5800539?v=4","gravatar_id":"","url":"https://api.github.com/users/Jonchun","html_url":"https://github.com/Jonchun","followers_url":"https://api.github.com/users/Jonchun/followers","following_url":"https://api.github.com/users/Jonchun/following{/other_user}","gists_url":"https://api.github.com/users/Jonchun/gists{/gist_id}","starred_url":"https://api.github.com/users/Jonchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jonchun/subscriptions","organizations_url":"https://api.github.com/users/Jonchun/orgs","repos_url":"https://api.github.com/users/Jonchun/repos","events_url":"https://api.github.com/users/Jonchun/events{/privacy}","received_events_url":"https://api.github.com/users/Jonchun/received_events","type":"User","site_admin":false},"created_at":"2019-09-23T13:16:45Z","updated_at":"2019-09-23T13:16:45Z","author_association":"NONE","body":"> Could this possibly be a behavior introduced by the Phaser Spine plugin?\r\n\r\nYes, it probably is. I guess `skeleton.setSkinByName(\"default\");`  is not a call that is always valid. I'll go report this on the Phaser end. (They run the above upon instantiation of every Spine game object... which is not great if you're not always going to have at least an empty default skin)\r\n\r\nThanks for looking at this!"}}
{"actor":{"display_login":"Jonchun"}}