Licinio Souza

Hi!

Can you help me?
The problem: after exported, the structure of the folders, names and dimensions of the images is lost.
With this result is more hard to identify the assets and change to reuse in Unity or for artists edit, etc.ee

So, It's possible keep name, folders and/or original pizel size of the sprites?

Thanks in advance! :)
You do not have the required permissions to view the files attached to this post.
User avatar
Licinio Souza
  • Posts: 13

Misaki

Hi,

Unfortunately, it is not possible to decide the naming of the atlas pages as you like or based on the folder name on the Spine editor. We have discussed several solutions to this in past posts, which we hope you will find helpful:
Deterministic (or editable) names for exported texture files
Mix and match outfits + Addressables loading issue
User avatar
Misaki

Misaki
  • Posts: 1020

Licinio Souza

Thanks you so much for this explanation Misaki ! :)
User avatar
Licinio Souza
  • Posts: 13

Erika

Hello! May I however suggest an alternative workflow:
You can pack your images into separate atlases by organizing them in the folders so that one folder corresponds to an atlas page you'd like to get. You can then use texture packer to pack the images folder respecting the folder structure if you place a pack.json file in each folder (which also has the big advantage of allowing you to even have different packing settings for each generated atlas page!)

Below are the relevant user guide entries for your case:

Texture packing - Spine User Guide: Folder structure
Texture packing - Spine User Guide: JSON Configuration
User avatar
Erika

Erikari
  • Posts: 3113

Licinio Souza

Tnx Erika! :o
I'll see with the Devs here :)

You guys are so kind.
Muito Obrigado.🤗 ✨

---

Hey, worked very well your solution!
Can help me again?

The export process was runnig normally since december but now, is occurring the "missing atlas"

I'm sending here as example, the beard asset. Looks correct, I think, the path. What is the problem? :o

Thanks in advance!

[edit:] to simplify the check and to send more simple screenshot, I turned off the skins, to show only phew graphics in the window report of the unity.
You do not have the required permissions to view the files attached to this post.
User avatar
Licinio Souza
  • Posts: 13

Misaki

Thank you for sending your project, I found some causes that importing exported files to Unity will fail. I recommend that you read the user guide again, as you probably do not understand many of the settings correctly.

To solve the error, please do the following:
  • Uncheck Combine subdirectories in texture packer settings window.
This setting is used when you want to combine all subdirectories into a single page, but in your case, you should uncheck this since the pack.json files define the pages.

  • Delete empty "pack.json" files in the "character_assets" folder.
To begin with, you have set the pack setting to Image folder in your JSON export settings, so the texture pages will be created for each folder without pack.json. The complication was because you checked Combine subdirectories in your texture packer settings. This is a conflicting setting, so let's clear that up once. I confirmed the empty pack.json files in the "character_assets" folder are unnecessary except for the following two:
・The pack.json in the "armors > 01_cloth_male" folder
・The pack.json in the "male" folder
In these two pack.json, write the following JSON:
{
combineSubdirectories: true
}
The JSON above allows images from a particular subdirectories to be combined into a single page.

  • Uncheck Flatten paths in texture packer settings window.
When Flatten paths is checked, subfolders are stripped from region file names in the .atlas.txt file.
Flatten-paths.jpg

This option is used for a case when you want to set up skins by code in Unity. In your case, there is no need to check this option since you have set up skins on the Spine editor and want to use them as are.

  • Uncheck Export for each "ref" attachments in the Tree view.
Uncheck the Export checkbox in all skins. These images will be ignored during export by pack.json, but the settings in the editor make them eligible for export, resulting in an error as "missing regions".
ref-export.png


When you have done the above, you should be able to import correctly. If something is going wrong, please let us know!
You do not have the required permissions to view the files attached to this post.
User avatar
Misaki

Misaki
  • Posts: 1020

Licinio Souza

Outstanding! Worked very well! :scared: 👏👏👏👏
Was a true class! 💖

ahah as artist, I have few (almost nothing) technical knowledge :( and your explanation was amazing. 🌈
I'll visit the user guide again as you recommended.


Tnx a lot!
Muito obrigado novamente 🤗✨✨
User avatar
Licinio Souza
  • Posts: 13

Misaki

I'm glad to hear that it worked well :D
If there is something unclear in the user guide, please feel free to post them in this forum!
User avatar
Misaki

Misaki
  • Posts: 1020

Licinio Souza

Working very well the previous solution!
--

Now we are trying to change the attachments in unity. It's a basic operation, but we are novice in the setup. See the attachment please.

I'm exporting this character with full attachments visible, because is more easy to I manage the pieces, order layers, etc, in Spine.

I sent in email, the source files, perhaps, changing the weapon we can learn here the method to change all.
Tnx in advance! =D
You do not have the required permissions to view the files attached to this post.
User avatar
Licinio Souza
  • Posts: 13

Nate

We don't normally dive into user projects if it can be avoided. It sounds like you just need to use Skeleton setAttachment. See that link for the API reference. See here for runtime docs:
Runtime Skeletons - Spine Runtimes Guide: Changing attachments
And here for spine-unity docs:
spine-unity Runtime Documentation: Setting Attachments
User avatar
Nate

Nate
  • Posts: 12129

Licinio Souza

Thanks a lot, Nate!
We'll check the links :yes: :yes: :yes: ✨✨✨
User avatar
Licinio Souza
  • Posts: 13


Return to Editor