• RuntimesUnity
  • Vertice Animation + Unity Addressable issue

Hi again, last week I found another issue with spine animations and now I have both Spine and Unity sample projects with a reproduction of the problem.

The problem relates to trying to use Timeline playables and Addressables, where Timeline tracks that contain Spine animations using simple vertice animation do not function as expected.

Here is the public repository with the sample projects and also videos explaining how to reproduce it:

The videos are in the README of that repo. If you need any more inputs, please let me know 😉

Thanks.

    Related Discussions
    ...

    @sandolkakos Thanks very much for the great reproduction project and detailed explanations! 🙂 We could now reproduce the issue on our end. We will get back to you here on the forum as soon as we've figured out what's going wrong. Thanks for reporting!

    Issue ticket URL:
    EsotericSoftware/spine-runtimes2309

    sandolkakos The problem is due to the Adressable's Timeline playable creating a new SkeletonData from the SkeletonDataAsset as if it has not been loaded, and not re-use the existing SkeletonData of the skeleton that is later bound at the Timeline playable. Then an equality check fails and thus does not apply the DeformTimeline, thus not applying the vertex deformation animation since it thinks that the attachment has been swapped out with another attachment (which is then not receiving deformation animation by design).

    The issue seems to be because of streaming assets creating copies of shared assets, see https://docs.unity3d.com/Packages/com.unity.addressables@1.18/manual/ManagingAssets.html:
    "However, if you use the same asset in more than one of these categories, then Unity makes copies of the asset when building rather than sharing a single instance."

    Also in section "Shared assets in groups":
    "If more than one Addressable references the same non-Addressable asset, then copies of the non-Addressable asset are included in each bundle containing a referencing Addressable."

    The solution seems to be to either move all skeleton assets that are referenced (especially SkeletonDataAsset) into either the same bundle (Addressable Group), or to create a separate bundle and create dependencies from the other referencing bundles:
    "To eliminate this duplication, you can make the dependency an Addressable asset and include it in one of the existing bundles or add it to a different bundle. Once you make the dependency an Addressable, the bundle it is a part of is loaded whenever you load one of the Addressables that reference it."

      Harald Thank you a lot for digging into it. I will try your hints and will come back when I have some results.

      8 mois plus tard

      The issue was really due to having 2 instances of the assets. In my real project, everything is marked as addressable and it works nicely.

      Sorry for taking a long time to reply here. I had no time yet to change the example repository I posted here to show the only changes necessary to make it work. But I have plans to do it one day since I know it would help other people. If I do so, I will post here.