Sorry to hear you're having troubles. Most likely the read/write enabled or texture compression settings of the texture are setup incorrectly for reading the texture. Did you check the list of common causes for repacking to fail on the spine-unity docs pages here (section Runtime Repacking
, Important Note
)?
White boxes on spine in build when using "Repack"
Thank you for responding! Sorry for not getting back, I will check this next time it happens
-niclas
Hey nicmar, I'm facing the same problem here and it only happens when I run it on android, maybe ios too but I haven't tested it. Have you found the solution? I have checked read/write on my textures.
@AmazeFPig Sorry to hear you're facing troubles! Which version of the spine-unity runtime (name of the unitypackage, also listed in Assets/Spine/version.txt
) are you using?
Harald
4.1-2022-10-31
- Modificato
Harald
And here is the code I'm using
`
public void OptimizeSkin()
{
// 1. Collect all the attachments of all active skins.
collectedSkin = collectedSkin ?? new Skin("Collected skin");
collectedSkin.Clear();
//collectedSkin.AddSkin(skeletonGraphic.Skeleton.Data.DefaultSkin);
collectedSkin.AddSkin(skeletonAnimation.Skeleton.Data.DefaultSkin);
collectedSkin.AddSkin(equipsSkin);
// 2. Create a repacked skin.
// Note: materials and textures returned by GetRepackedSkin() behave like 'new Texture2D()' and need to be destroyed
if (runtimeMaterial)
Destroy(runtimeMaterial);
if (runtimeAtlas)
Destroy(runtimeAtlas);
//var repackedSkin = collectedSkin.GetRepackedSkin("Repacked skin", skeletonGraphic.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial,
//out runtimeMaterial, out runtimeAtlas, maxAtlasSize: 1024, clearCache: false);
var repackedSkin = collectedSkin.GetRepackedSkin("Repacked skin", skeletonAnimation.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial,
out runtimeMaterial, out runtimeAtlas, maxAtlasSize: 1024, clearCache: false);
collectedSkin.Clear();
// You can optionally clear the textures cache after each ore multiple repack operations are done.
//AtlasUtilities.ClearCache();
//Resources.UnloadUnusedAssets();
// 3. Use the repacked skin.
//skeletonGraphic.Skeleton.Skin = repackedSkin;
skeletonAnimation.Skeleton.Skin = repackedSkin;
RefreshSkeletonAttachments();
}
`
What I did was generate new attachments and set this new attachment on slot, after that I call this OptimizeSkin(). It seems that some attachments are replaced by the white box
Harald
And this is how it looks like
AmazeFPig 4.1-2022-10-31
Thanks for the additional info. Please note that you're not using the latest version of the spine-unity runtime. Could you please check if updating the runtime perhaps already resolves the issue? As always, be sure to back up your work before updating to be on the safe side.
Harald
I have updated to the newest version and unfortunately it didn't solve my problem
@AmazeFPig Sorry to hear that your issue persists. Could you please send us a minimal Unity project which still shows this issue? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context. Then we can have a look at it.
Harald I have sent you an email with a google drive link to my unity project. Let me know if you have trouble accessing or reproducing the issue.
Thanks for your patience.
- Modificato
Thanks for sending the email, we received your package, but it is 2.6GB in size (uncompressed about 7GB). In general, never include the Library
directory when sending reproduction projects, that alone contributed 5GB of unpacked size on disk, and will be deleted before opening the project anyway. Apart from that, your project is far from being minimal, and it does not compile after opening it in Unity (related to your used thirdparty plugins), thus we can't even enter play mode in your test scene. Also you mention in your email that the problem occurs when using a custom flutter Unity widget on Android, which adds yet another unnecessary layer around it.
What I forgot to mention earlier, there are multiple causes for skin repacking to end up failing with white textures, which are documented in the Note
box here:
http://esotericsoftware.com/spine-unity#Combining-Skins
Please check these listed points, perhaps Texture settings for Android are messed up in your problematic textures.
If none of the above resolve your problem, you can try building a really minimal reproduction project this time which does not use any thirdparty plugins, builds directly to Android without any wrapper layers and uses only one or two scripts to reproduce the problem. The reproduction project shall not include a game, you need to strip the logic down to include only the problematic logic, no other lines of code.
- Modificato
Harald
Hey Harald, I just want to let you know that this has been solved. It turns out that I didn't turn on Read/Write on the textures that were exported from Spine. Thanks for your support, cheers.
@AmazeFPig Thanks for getting back to us, glad to hear you've figured it out!