max0805 Posted March 11, 2020 Share Posted March 11, 2020 (edited) I already read this topic : https://www.html5gamedevs.com/topic/32522-one-atlas-many-json-for-spine/ and I following the anwser, and can not find the solution. I want to using one atlas to manage all json. I want to manage json by one atlas so I wrote this code. But it show me like this : https://imgur.com/a/jITTg4w Looks I just make a dynamic atlas. How do I using one atlas to contain all spine information? slot_1601_TEST.7z Edited March 11, 2020 by max0805 ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 11, 2020 Share Posted March 11, 2020 This is how pixi-spine loader works: https://github.com/pixijs/pixi-spine/blob/master/src/loaders.ts#L29 This was the attempt to fix the single atlas issue but I dont like it so i didnt merge it : https://github.com/pixijs/pixi-spine/pull/281 Unfortunately, many people are struggling with this particular issue. I thought that community can deal with it, but it looks like it cant I'm the only one who can actually fix that and patch pixi-spine, but I'm very nervous about, I just had a panic attack. Please understand me and either 1. wait when I'm ready to fix it 2. do it yourself and save pixi-spine. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 11, 2020 Share Posted March 11, 2020 Here's another thread about it: https://github.com/pixijs/pixi-spine/issues/335 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 11, 2020 Share Posted March 11, 2020 OK, I'm taking a break on this issue till weekend, is that acceptable? Quote Link to comment Share on other sites More sharing options...
max0805 Posted March 11, 2020 Author Share Posted March 11, 2020 (edited) thank to reply , I just want to make our file smaller as soon as possible. Our artist say he can make one atlas to manage all json and spine so he say that may using in pixi.js. I know you need to fix a lot of new issue, cos this awesome plugins is too much user maybe you can pointer a way to using hard code fix this issue. Edited March 11, 2020 by max0805 ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 11, 2020 Share Posted March 11, 2020 Options 1. Take https://github.com/pixijs/pixi-spine/pull/281/files , apply it to latest pixi-spine, rebuild it. Add your atlas file in loader first, it should work. specify "PIXI.loaders.useMasterAtlasData=true" - that's for atlas itself. For image you have to specify imageLoaderAdapter for it, maybe through Texture.from() If it doesnt work - debug. 2. Use same atlas file for all json files, just copy it many times. But for image use your own imageLoaderAdapter. That way texture regions will be copied many times but bitmap data will be loaded&stored only once. If you want real solution - wait for weekend Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 11, 2020 Share Posted March 11, 2020 (edited) Actually, everything is easier. One person just gave me this: See the line about metadataAtlas https://github.com/pixijs/pixi-spine/blob/0e0431a81b2a061a872730b2cd6f7fa83413763b/src/loaders.ts#L66 We can load one main spine skeleton that has atlas with everything, then load others with same atlas. In that case you need json/atlas/png file and not just "test atlas/png" you made. preLoader.add('mainSpine', 'img/main.json'); preLoader.load(() => { const options = { metadata: { spineAtlas: preLoader.resources.mainSpine.spineAtlas } }; loader.add('hello', 'img/Cherry.json', options); loader.add('hello2', 'img/Bell.json', options); loader.load(onAssetsLoaded) }); function onAssetsLoaded() { //... } I put it here: https://github.com/pixijs/pixi-spine/blob/master/examples/single_atlas_multiple_models.md Edited March 11, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
max0805 Posted March 11, 2020 Author Share Posted March 11, 2020 Thank you so much, I will try it. That was awesome of that quickly response solution. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 11, 2020 Share Posted March 11, 2020 2 minutes ago, max0805 said: Thank you so much, I will try it. That was awesome of that quickly response solution. Power of russian html5 gamedev telegram chats. Quote Link to comment Share on other sites More sharing options...
max0805 Posted March 18, 2020 Author Share Posted March 18, 2020 hi, I can not using this way , preLoader.resources.mainSpine.spineAtlas is undefined. And artist can not out put the json file with this issue. Can I have a official solution for this. My javascript not very well. Help. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 18, 2020 Share Posted March 18, 2020 (edited) > Can I have a official solution for this. My javascript not very well. Debug spine loader. Even with official solutions you will have to do it. Please make minimal demo with the approach i mentioned that doesnt work for you and i'll fix it, no need to publish your actual spine files, but you need to make the same exact situation: two spine models+atlases and one model+atlas that has ALL attachments in it. Or, alternative, texturepacker atlas with all attachments. Edited March 18, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
max0805 Posted March 24, 2020 Author Share Posted March 24, 2020 I can not using the same way make what I want to do. I see my project when I using PIXI.Loader add json and using add() to add my json then load. It will give me the spineData in loader.resources.spineData when load finish . But when I using your way I can not take this property. They is a similary names data. But when I using it they will say "Cannot read property 'children' of undefined" This is my code example. Please check pixiatlastest.html line 47 and 58. mytest.rar ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 24, 2020 Share Posted March 24, 2020 Got it, I'll look soon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.