Should be my confessed on the Mecanim Control...

I am using an asset which takes 2D Animation Clips through the Unity Animation system
https://imagizer.imageshack.com/img922/2490/ujWRp4.png
So it needs a Mecanim control, and Spine has a Mecanim Control, should be working?

But I am facing a problem that, by generating the Mecanim Controller from the Spine-Unity Runtime,
it becomes just a frozen image on the first frame, instead of an animation clip in the Animation, so it does not work for me.
https://imagizer.imageshack.com/img922/3392/qGPrYX.png

I can only get a animation work by baking them, but then the animation become strange, losing a lot of information.
https://imagizer.imageshack.com/img923/7287/1j9UPq.png

So, really wish to know if there is a way to fit Spine clips into the Unity Animation, so I don't need to bake them?

  • Misaki hat auf diesen Beitrag geantwortet.
    Related Discussions
    ...

    bobbylamhk
    I'm confused about what you want to do. You have the Animation window open, so are you trying to edit your Spine animations in the Unity's Animation window rather than want to use the mecanim controller? If so, then baking the animation as you tried would be the correct way to do it.

    The basic usage of the SkeletonMecanim component is shown in this video, so I hope you will take a look at this first (SkeletonMecanim is introduced from 17:08 to 18:06):

      Misaki
      Actually I do not need to edit the animations with Unity's Animation window.

      The problem is the asset I am trying is originally designed for 3D(Mecanim), and 2D sprite animations clip, and is based on Unity's Animation to add customized Hit Boxes frame-by-frame.
      This is their example video for reference.
      https://www.youtube.com/watch?v=7WHkkioBSMw&t=30s

      I tried to put the clips from Spine-Unity Runtime mecanim controller into the Animation window, but the animation just won't play, and giving difficulties to add the Hit boxes.
      Baking seems that will really break the animations, so I just wonder if there is any other way to play Spine animations in Unity's Animation system?

        bobbylamhk Hmmm, I watched the video you shared the link and I can understand using this Custom Hitbox Editor for Sprite animations, but I don't understand why you would like to use it for Spine animations. Spine allows you to set hitboxes to your skeleton on the Spine editor by creating bounding box attachments, and you can extract the shape using the BoundingBoxFollower component. I think it is more manageable and easier to use.

        Baking seems that will really break the animations,

        Yes, as noted in the Skeleton Baking window, some elements are not supported, so baking may cause some of the animation to be lost.

        so I just wonder if there is any other way to play Spine animations in Unity's Animation system?

        This is impossible because the animation playback system of the Spine runtime is different from that of Unity.

        Rather than focusing on using that tool, it should be better to think about what you ultimately want to do and how Spine can be used there.

        bobbylamhk I tried to put the clips from Spine-Unity Runtime mecanim controller into the Animation window, but the animation just won't play, and giving difficulties to add the Hit boxes.

        Your observation is correct. Unfortunately the Unity API so far has not provided any way for us to let the dummy Mecanim clips trigger our own playback code when played in the preview window. This issue is tracked in this issue ticket. It has been on hold for a long time because of this limitation. We might provide some workarounds in the future, unfortunately it will likely not be the clean and intuitive solution that one would hope for.

        Note that you could add events in the Animation window in Unity, if for some reason you can't use Spine's event system. The problem there is that the animation preview is missing to let you see where exactly inside the animation you are currently. Thus we highly recommend authoring your events in the Spine Editor and reacting to them on the Unity side accordingly.

        You don't need to use the Spine bounding box attachments that Misaki mentioned above if you want to avoid polygonal hit boxes and just need to enable and disable rectangular hit boxes at certain timepoints within an animation (which is reasonable).