- Edited
Easy way for texture packing?
Hi guys, I've got a issue to found a easy way for Texture Packing using subdirectories :/
Currently, it's very impractical to export a spine with an atlas that doesn't combine images from several subdirectories.
We have to:
1) Export the skeleton as binary (or json) without generating the atlas. (otherwise it will only generate one texture with everything combined as mentionned in the documentation)
2) Export using Texture Packer to export the atlas
3) Edit the resulting atlas because it doesn't reference the images the same way as the .skel
With a folder structure like this:
images/
images/folder1
images/folder2
The resulting atlas will reference images like this:
images/folder1/image1
rotate: false
xy: 0, 3
...
But the .skle / .json expects them to be referenced like this:
folder1/image1
rotate: false
xy: 0, 3
...
Notice the "images/" folder that's added when using Texture Packer.
The images are referenced properly when using the "create atlas" option during the binary export (But then the atlas only contains one texture)
Are we doing something wrong? We're not sure what's the point of using the Texture Packer export if skeletons can't use the resulting atlases directly.
Hi Calire, I tried exporting the goblins project by placing a pack.json file in each folder and then using texture packer. The resulting atlas file has names like: goblin/eyes-closed
which should be what you want according to your description. Could it be that when you choose the folder to pack, you choose the project folder instead of the images folder of the project?
Hi Erikari
Actually, you right, it's working pretty well with your way to export. It's fine now , thanks !
Little question: Do you know why the option "texture packer" is not the same windows of "export" in spine?
By same window do you mean why texture packer
is in the main menu, and export
is in the main menu under a different voice?
I think it's because you can basically pack any kind of image with texture packer, while export
exports your project .
I mean, it make senses I think to have this kind of window:
With texture packer option:
Without the texture packer option (actually in spine):
I don't think it's really alright to have it there, as you're only exporting skeleton and images of the current project, so that's why you can specify the atlas export, while with texture packer you can include multiple projects as well as images that don't belong to any Spine project.
Sorry, it's not easy to explain precisely what the issue is ( ^-^);
So the fact is, the option "combine subdirectories" doesn't works when you export with the "normal" way.
-When it's select with "normal Export", it's make only 1 atlas at the end.
-When it's not select with "normal Export" , it's make only 1 atlas at the end.
If this option work, we can do separate atlas directly in the "classic" Export's option, and manage all the atlas at the end.
Since I use "Texture packer" option in different projects, I always have to do the link between the Json and the Atlas.
I mean, it's logic to have a link by default and unselect the option if you need to generate only the atlas :yes:
-
Hey hey, I just found this topic, I could have a great use of this small checkbox also. Having several textures for several skins could help a lot.
I think this is a bug, I tried everything to create 2 atlas with subfolders with the export button, no way to make it working, now with the texture packer, everthing worked fine.
So I think there is a bug in the export with atlas.
Hi MichelVictor, this is not a bug, as it's explicitly said it behaves like this in the user guide: Texture Packing - Spine User Guide: Packing during skeleton data export
Actually there was a bug with Combine subdirectories
in recent 3.7 betas. It is fixed in 3.7.26-beta! Sorry for the trouble.