skarasuko

There are images I use in the Editor as reference, so they should not be exported in the Texture pages. I can place the reference images in a new skeleton if they have no animations, but I also want to preview animations in various contexts and interactions. For example, my character is able to hold different objects or is interacting with animated devices.

Currently, there's no customization when it comes to packing (in 4.0). I would like a way for the Texture Packer to exclude specific folders. Maybe detecting a specific image folder named like "null" and ignoring it during Texture Packing.
skarasuko
  • Posts: 120

Nate

You can customize texture packing settings per folder:
Texture packing - Spine User Guide: JSON Configuration

Place a pack.json file (it's just a text file) in the folder you want to not be packed with this content:
{
ignore: true
}
You can also customize other settings of course. One of the most common ones I use is to enable Combine subdirectories only for a particular folder (and all its subdirectories):
{
combineSubdirectories: true
}
User avatar
Nate

Nate
  • Posts: 11930

skarasuko

I placed the .json file in the folder I want ignored, but it doesn't work for some reason. Is there something else I have to consider, like do I need to use the Texture Packer instead of Export JSON?
skarasuko
  • Posts: 120

Misaki

pack.json can also be used for JSON export, but it is useless unless the Image folder is selected in the Pack setting.
Screen Shot 2022-06-29 at 11.48.41.png
You do not have the required permissions to view the files attached to this post.
User avatar
Misaki

Misaki
  • Posts: 756

skarasuko

I've already set that. So I am simply not sure why it still exported the undesired images in the folder.
skarasuko
  • Posts: 120

Misaki

We need to see the actual file to determine the cause. Could you send us the files that can reproduce the problem for us?
User avatar
Misaki

Misaki
  • Posts: 756

Nate

The pack.json files are not used when using Pack [Attachments]. You either need to choose Image folder or run the texture packer separately from the JSON/binary export.
User avatar
Nate

Nate
  • Posts: 11930

skarasuko

Misaki wrote:We need to see the actual file to determine the cause. Could you send us the files that can reproduce the problem for us?
Uploaded. Image folder has already been toggled, so I just don't know what's wrong. This is in 4.0.64 official, not 4.1 beta.

It might be nice to have a UI in the Editor to mark a folder as ignored and generate a .json automatically (if it works).
You do not have the required permissions to view the files attached to this post.
skarasuko
  • Posts: 120

Nate

You've named your file .pack.json. It needs to be pack.json (no leading .).

The UI can be used to save a pack settings JSON file, which can be named pack.json and placed in a folder. There are some settings though, like ignore, that aren't available in the UI.
User avatar
Nate

Nate
  • Posts: 11930

warmanw

Nate wrote:You can customize texture packing settings per folder:
Texture packing - Spine User Guide: JSON Configuration

Place a pack.json file (it's just a text file) in the folder you want to not be packed with this content:
\
ignore: true
}
You can also customize other settings of course. One of the most common ones I use is to enable Combine subdirectories only for a particular folder (and all its subdirectories):
{
combineSubdirectories: true
}
Whaaat? I did not know :D
User avatar
warmanw

Kickstarter Backer
  • Posts: 332

skarasuko

Nate wrote:You've named your file .pack.json. It needs to be pack.json (no leading .).

The UI can be used to save a pack settings JSON file, which can be named pack.json and placed in a folder. There are some settings though, like ignore, that aren't available in the UI.
Oh. I see. I'll simply have to keep this in mind.
skarasuko
  • Posts: 120

Nate

warmanw wrote:Whaaat? I did not know :D
Yep, it's neat! You can set most texture packing properties per folder. For example you might want to strip whitespace or duplicate padding on some folders, but not others.

Note if you use Combine subdirectories then any pack.json files in those subdirectories won't be used, because the packer will try to place all the images found in the subdirectories in the same atlas page.
User avatar
Nate

Nate
  • Posts: 11930


Return to Editor