• Unity
  • Optimize draw call on unity

  • Изменено
Related Discussions
...

I have 2 anime files. Anim file 1 uses texture a, Anim file 2 uses texture b. When exporting anim to use in unity, can the textures of anim files 1 and 2 both contain texture a, b?

Yes, you can put all attachment images in a single folder and then either run the Texture Packer manually via the menu Spine - Texture Packer, or when exporting your skeleton enable Pack and select Image Folders instead of Attachments as described here.

You can find more detailled information here:
Texture packing - Spine User Guide: Folder structure
Texture packing - Spine User Guide: Packing during data export

5 дней спустя

Thanks for your help. I tried enable pack and select Image Folder but the position of texture a and b in the texture of the 2 anime files is different.

I'm afraid I don't understand what you mean by that. Could you please share a screenshot or describe in more detail?

Can you give me an email please? I will send screenshots via email. Because my project is not published yet.
Thank you so much
.

Sure, please send it to contact@esotericsoftware.com shortly mentioning the URL of this forum thread, we will of course treat it confidentially.


Thanks for sending the assets, we received everything.

I tried enable pack and select Image Folder but the position of texture a and b in the texture of the 2 anime files is different.

If you mean that the two atlas textures have placed the individual attachments on different locations, then yes, this will always be the case. You then use only the All_Element.atlas.txt and All_Element.png atlas files and discard the Hammer.atlas.txt and Hammer.png files. Then you can assign the All_Element atlas at both SkeletonDataAssets.

6 дней спустя

Thank you so much but it encountered a skin display error when assigning the atlas at another SkeletonDataAssets. I have sent the anime file to you mail

Thanks for sending the reproduction assets. Unfortunately we could not reproduce the problem you are encountering. I assigned the Skin_Booster_Atlas asset at the Skin_CupCake_SkeletonData asset and it displayed everything correctly (screenshot sent via email for confidentiality reasons), without any error messages or display errors. Could you please describe in more detail what display errors you encountered?

this is my setting and my error

Thanks for providing the error screenshot, now I can see what you mean. In general please always provide such screenshots up front so that we know what to look for.

The problem here is most likely that you are using an input image with a lot of whitespace (at the top of the clock) and use the whitespace with a MeshAttachment in one project, but export it from another project where the whitespace is not used by any MeshAttachment and during atlas texture export have Strip whitespace X/Y enabled (see description here). Now since upon export no skeleton uses this whitespace, it is stripped.

There are multiple solutions to this problem:

  • Disable Strip whitespace X/Y.
  • Remove the whitespace from the input image.
  • Adjust the mesh of the MeshAttachment to ensure that it does not reach into this transparent area.
  • Add the skeletons from the other project to the same project before exporting (to have a user of the whitespace).

Thank you so much. I will try

Also note: when packing from the CLI you can specify multiple projects (-j) for the purpose of finding mesh attachments that use the images so the whitespace used by meshes doesn't get removed.