(This is my first time posting, sorry if I don't post correctly)
I was making an animation for an item (it played when instantiating the prefab) using the Skeleton Graphic (UI). The first version I did of the animation worked great. Still, I wanted to change the color according to the item's rarity, so I decided to re-export but change the color to grayscale so I could apply the color through code in Unity.

The problem is when re-importing to Unity. The animation re-imported is animated but what I see is (I think) the various frames but shifted the image or something. I'm not sure if the problem is in the atlas or the skeleton or where. But I haven't changed any of that and it suddenly broke. And Unity itself doesn't give me any errors.

As of right now, I have tried:

  • Reexporting as JSON, binary and different options
  • Rotating the PNG outside
  • Tested every combination of checkboxes in the SkeletonGraphic (UI) and SkeletonData

I expected the same animation but in grayscale (since I didn't touch anything else).

What happened is that the animation broke (probably not the correct wording) and I see what I think are parts of multiple frames.

My runtime version is 4.1.Xx

Thank you for your time

    Related Discussions
    ...

    Sorry to hear you're having troubles.

    Lladruc The problem is when re-importing to Unity. The animation re-imported is animated but what I see is (I think) the various frames but shifted the image or something.

    If you exported your skeleton data as .json or binary, you don't get individual frames exported as images but instead atlas textures that contain all your attachments, in packed form to take up less space. These atlas textures are then applied to the skeleton mesh, which is animated at runtime in Unity by the SkeletonGraphic component.

    If textures are offset, it sounds as if the .atlas.txt file does not match the texture .png file. Are you sure that you have copied both files over from the export directory to the Unity project directory? If so, please check whether perhaps you have accidentally exported the newer file as .atlas instead of .atlas.txt file, which would then be ignored.

    If that does not resolve your issue, it might be the easiest way to open the respective directory in your file explorer and delete the old exported skeleton asset files (.json, .atlas.txt and .png files, don't delete the other files if you want to keep existing scenes working) before copying the newly exported assets over. Then after the files have been copied, you can switch to Unity to have everything imported.

    Also see the documentation section here:
    https://esotericsoftware.com/spine-unity#Updating-Spine-Assets

      Harald

      I have an atlas (I may not have clarified that) in the .atlas.txt format so it's not that.

      And I tried what you suggested of copying the newly exported asset but I get the same result I would get if I deleted the entire animation and exported everything from the new one.

      From the documentation I found this:

      Only use Materials with special CanvasRenderer compatible shaders at SkeletonGraphic components, such as the Spine/SkeletonGraphic* shaders which are assigned by default. Do not use URP, LWRP or normal shaders like Spine/Skeleton with a SkeletonGraphic component. Seeing no visual error does not mean that the shader works with SkeletonGraphic. We have seen cases where it renders incorrectly on target mobile devices while rendering without any issues in the Unity Editor. As other UI components, SkeletonGraphic uses a CanvasRenderer instead of a MeshRenderer, which uses a separate rendering pipeline.

      Normal Materials assigned at a SpineAtlasAsset are ignored when instantiating a SkeletonDataAsset as SkeletonGraphic, only the Textures are used. You can use a SkeletonGraphicCustomMaterials component to override Materials at a SkeletonGraphic component.

      I tried changing the materials to Spine/SkeletonGraphic but it didn't change anything. Any ideas?

        Does it display correct in the Inspector Preview when selecting the skeleton's SkeletonDataAsset in the Project panel?

        It might also help if you could share a screenshot that shows how your skeleton is incorrectly displayed. What would be even better is to share your problematic exported skeleton assets with us so that we can have a look at them. If you can't share it here on the forum, you can send us an email to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

        6 dias depois

        Lladruc Thank you so much for sending your skeleton files. I was able to reproduce the problem in SkeletonViewer, so I believe this was an issue on the Spine editor side, not on the Spine runtime side. However, the skeleton data you sent was exported from Spine 4.1.16, with is a slightly older version, so I re-exported it with the latest version (Spine 4.1.23), then the problem can be fixed.

        Your skeleton uses a sequence attachment, and in fact we have added various fixing to sequence attachments between 4.1.16 and 4.1.23, so I assume the problem was fixed by one of those.

        It is always safe to update the patch version of the Spine editor, so please use the latest version (4.1.23) and please check if that fixes the problem.

        6 dias depois

        Thanks for the help! I will try doing what you suggested in the following days. I fully expect the same result you got. Once I have tried it I will reaffirm it by posting it here and closing the post (I'm guessing I can close it myself since I opened it).

        Thank you so much again.