• Bugs
  • Folder Structure with Atlas not working

I tried to create 2 separated using the folder sctructure like said in the manual.
So I create 2 subfolder
Images>
folder1 and folder2

Each folder has 3 images each

When I export creating an atlas, even with the checkbox "Combine subdirectories" unchecked, only one atlas with 6 images was created. When I used "Texture Packer" it worked fine with 2 atlas.

 Loading Image

Related Discussions
...

That currently only applies to the independent Texture Packer function, as far as I know.

The packer behavior you get with skeleton data export only picks up all the attachments used by your skeleton and packs them in one atlas. It doesn't use folders to determine atlas arrangement.
See the text: Texture Packing - Spine User Guide: Packing during skeleton data export

This is terrible, because I want to separate atlas for specific images used for skin and things like that, another thing is I created a normalmap for the images and now I update the project and I want to put the new images in another atlas so the images doesnt change place where I created the normal map.

Why not use Texture Packer? Is there something it can't do?

Well, it seems that the Json for Unity not work when I use the Texture Packer

It should work fine. You only need to make sure the paths you use in Spine match the paths stored when you pack your atlas.

How exactly is the work flow to use Json Export and Texture Packer? Because I can't make it work.

MichelVictor wrote

How exactly is the work flow to use Json Export and Texture Packer? Because I can't make it work.

Is there part of the documentation that doesn't make sense? What exactly doesn't work? In other words, what did you try, what did you expect, and what did you actually see happen?

MichelVictor wrote

When I export creating an atlas, even with the checkbox "Combine subdirectories" unchecked, only one atlas with 6 images was created. When I used "Texture Packer" it worked fine with 2 atlas.

Each run of the texture packer creates one atlas (an atlas may have multiple images (aka pages)).

When exporting JSON and creating an atlas, it runs the texture packer once per skeleton in your project and only includes the images the skeleton uses. Combine subdirectories does nothing because running it in this mode doesn't use file system folders, instead it packs the images the skeleton uses.

You can also run the packer separately from exporting JSON. When doing this, combine subdirectories has an effect because it uses the file system folders to find images.

I'll tell what I want.

1 atlas for the body parts
1 atlas for each skin
1 atlas for effects (light emitions, use other materials like addtive, different specular)
A json that know where this images are in this 3 atlas.

If I export only json and after that use texture packer and put it everything on a folder, Unity can't reconize the texture for json.

To be clear, the only reason to have multiple atlases is if you are not loading all the textures at the same time. If you load them all at the same time, you only need one atlas (possibly with multiple atlas pages). Folders can be used to group images on to separate atlas pages of a single atlas, as described in the documentation.

To get 3 atlases, run the texture packer 3 separate times. If you want to use multiple atlases with a single SkeletonData, you'll need to customize the AttachmentLoader. By default the AtlasAttachmentLoader is used, which finds attachment images in a single atlas. For Unity/C# that happens here. See the calls to FindRegion? That method is defined at the bottom of the file. It already has support for multiple atlases, so you just need to configure it. Pharan can explain how to do that, I'm sure he will be along shortly.

hm, I don't know if we are talking about the same thing, maybe I mislead the exactly word.
What I need is 3 separated textures so I can make different material inside unity, but they are all used at the same time in the same skeleton and I need to decide witch little piece will go on each final texture.
Maybe the name is pages? I am confused right now haha.

Edit: Yes, now I confirmed, the word I wanted to use was "pages", I need 3 separated pages, but I need to decide with png used on spine skeleton goes on each of these pages.
For example I have a head.png and a helmet.png, I want to decide that head.png goes to page1.png and helmet.png goes to page2.png
Is that doable?

Yes. Organize your images into folders, one for each atlas page:

images/skin1
images/skin2
images/body
images/effects

Then run the packer on images. You'll get one atlas with a page for each folder. If you check Combine subdirectories then you'll get a single page (if they fit), so don't do that. Check out this section of the docs.

Yes this is what I did, but how I make this atlas works with Unity? Because if I export the json from the "export" button and use the packer it wont works on Unity.

An atlas exported from Spine certainly does work in Unity. We'll need more information to be able to help with your problem.

Well, lol, I find a way to work, the thing is, I was exporting first Json and after the Texture Packer, and it need to be first Texture Packer and after Json ....haha.
Finally I got it work! Thank you for the effort.

Glad you got it working! Maybe you had Create atlas checked when exporting JSON and it was overwriting the atlas you made when you ran the texture packer separately.

13日 後

Sooo... if it does the same result, this parameter is not working, right? On this particular window I mean.

 Loading Image

I don't understand what you mean. If you are doing JSON or binary export and are using 3.6 or choose Pack: Attachments in 3.7, then Combine subdirectories has no effect because packing is done using only images used by attachments, not by looking in folders.

Ok, I get it, so why put the option there, if not possible?