Hi, I made an animation, keying slot color.
SlotColor.alpha = 1 from frame 1 to frame 9 ,
SlotColor.alpha = 0 when at frame 10,
then SlotColor.alpha = 1 again from frame 11 to frame 20.
And there is no tweening curve, transition is straight mode.

However while in Unity runtime, slot's alpha value became 0.99608 instead of 1.0.
By the way I'm using urp shader PMA vertex straight texture workflow.
What may cause this issue?


    Related Discussions
    ...

    ara And there is no tweening curve, transition is straight mode.

    However while in Unity runtime, slot's alpha value became 0.99608 instead of 1.0.

    Sorry to hear you're having troubles. Do you mean you set the interpolation mode to Stepped curve? Because "straight mode" sounds like using Linear curve, which would be linearly interpolating the values, leading to the result you reported.

    Please also note that modifying the playback view's preview mode to Stepped only affects the preview, not the exported skeleton.

    If none of the above apply, which version of the spine-unity runtime (name of the unitypackage, also listed in Assets/Spine/version.txt or in the Package Manager) are you using?

    If you're using the latest spine-unity package, could you please share your problematic skeleton assets with us? You can send the exported assets to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context, or attach it to a forum posting. Then we can have a look at what's going wrong.

    • ara replied to this.

      Harald
      Yes I mean I set the interpolation mode to Stepped curve.
      I have sent an email with spine project and unity package file.
      My spine runtime version is [spine-unity-4.0-2022-02-28] spine editor version is [4.0.64].
      Both skeletonAnimation debug tool and renderDoc shader debug result shows 0.996 instead of 1.0.
      So I don't know whether it's because of animation keying or it's because of unity runtime formatting such as "(byte)alphaValue by MeshGenerator " which reduce its precision.

      @ara Thanks for reporting and sorry for the troubles! It seems that you've discovered an export bug which has slipped through for quite some time, as it seems to still be present in the current 4.2-beta version. We've created an issue ticket here for you to subscribe:
      EsotericSoftware/spine-editor778

      Please note that bot the 4.0 Spine Editor and spine-unity runtime will no longer receive updates, so if you stay at version 4.0, I'm afraid you will need to use a workaround for the issue.

      • ara replied to this.

        Harald Thanks Harald! This problem took me 2 days for debugging however I didn't expect the problem to be here. I'll modify fe value manually first, then check upgrade guide.

        @ara Please note that it's in general recommended to use binary .skel.bytes skeleton export instead of .json format, since the binary export results in reduced file size and load times.

        If you have loads of skeletons that need modification, another way could be to write a custom SkeletonDataModifierAsset which upon each import iterates over all animation's Timelines and if it's a RGBATimeline, access the Frames property and check and modify the alpha value accordingly.

        An even simpler fix would be to change the line frames[frame + A] = a; in Animation.cs to e.g. frames[frame + A] = a > 0.995f ? 1.0f : a;.

        • ara likes this.