• Unity
  • Repacking Skin Error

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

Hello,

I am getting this error when repacking my skins. Skins work fine when the are not repacked.

Texture rectangle is out of bounds (0 + 173 > 162)
UnityEngine.Texture2D:GetPixels(Int32, Int32, Int32, Int32)
Spine.Unity.Modules.AttachmentTools.SpriteAtlasRegionExtensions:ToTexture(AtlasRegion, Boolean, TextureFormat, Boolean) (at Assets/Spine/spine-unity/Modules/AttachmentTools/AttachmentTools.cs:509)
Spine.Unity.Modules.AttachmentTools.SpriteAtlasRegionExtensions:GetRepackedSkin(Skin, String, Shader, Material&, Texture2D&, Int32, Int32, TextureFormat, Boolean, Material) (at Assets/Spine/spine-unity/Modules/AttachmentTools/AttachmentTools.cs:429)
Spine.Unity.Modules.AttachmentTools.SpriteAtlasRegionExtensions:GetRepackedSkin(Skin, String, Material, Material&, Texture2D&, Int32, Int32, TextureFormat, Boolean) (at Assets/Spine/spine-unity/Modules/AttachmentTools/AttachmentTools.cs:400)

Any ideas?

Can you send us your png and .atlas.txt file?
You can send it to unity@esotericsoftware.com


25 Jul 2017 5:41 pm


We didn't seem get an error.
Are you using the latest runtime?
Did you change any texture import settings in Unity in its inspector?

I've managed to solve the issue.

Attached Sprites must be set to 'Full Rect' or it will create a packing error.

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

2 месяца спустя
OneUglyRobot написал

I've managed to solve the issue.

Attached Sprites must be set to 'Full Rect' or it will create a packing error.

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

Dude, you just saved my life with your insight! 🙂

I was having a problem with the larger animal in a collection (the elephant, of course).
There are 20 animals on my application and I'm painting it's pieces separately in Unity, getting the pixels of the painted Sprite, and finally making the attachment.

I've deleted and made the elephant setup on Spine from scratch 2 times, checked all possible variations from other 19 other animals that was doing good and nothing helped, not even applying the solution on your screenshot on my imported base sprites solved my case...

...but then I remembered that I'm creating those new sprites via code, so I'm posting my solution here for someone that could be using the same tools, in the same way:

byte[] baPixels = System.Convert.FromBase64String (base64Pixels);
Texture2D tex = new Texture2D (1, 1);
tex.LoadImage (baPixels);
Rect spriteRect = new Rect (0, 0, tex.width, tex.height);
Vector2 centerPivot = new Vector2 (0.5f, 0.5f);
Sprite receivedSprite = Sprite.Create (tex, spriteRect, centerPivot, 100, 1, SpriteMeshType.FullRect);

That's just it, passing the SpriteMeshType.FullRect parameter just like you did.

Thank you so much for sharing OneUglyRobot! :handshake:

Thanks for sharing the problem and solution you found too, marcosroque