Jamez0r

I'm testing out SkeletonMecanim - I added a couple events (in the Unity Animation tab) to some of my animations. I then made some changes in Spine, exported it, and updated the Spine Asset in Unity. The animation events were gone.

Is this intended? Should I not use events in unity's Animation, and only use events I set within Spine?

------------

Another thing I noticed - not sure if this is how mecanim usually works or not:
1) Create a Skeleton Mecanim
2) Open up your animator controller in the Animator window
3) Create a state, and drag-and-drop an animation into the Motion field in the inspector
4) Find that same Controller in the Project tab, expand it to show the list of animations
5) Select the animation that you had added to the state you created, and check the Loop Time checkbox
6) Run the game and get into the state you created -> the animation will not loop
7) Go back into the Controller in the Animator window, select the State you created, remove the animation from the Motion field and then re-add it
8.) Run the game and get into the state you created -> the animation now loops

Is it intended to work this way? I wouldn't think I should have to remove/re-add it for it to update

Thanks for any help!! :nerd:
User avatar
Jamez0r
  • Posts: 199

Harald

I then made some changes in Spine, exported it, and updated the Spine Asset in Unity. The animation events were gone.

Is this intended? Should I not use events in unity's Animation, and only use events I set within Spine?
Actually the main intended workflow is to setup events within Spine. Would this be a useful or crucial workflow to add events via the Animation panel? We thought that since it does not show any animation context, precise placement of events would be very cumbersome, or do you think otherwise?

Regarding the loop problem:
This is strange indeed, I usually always drag-and-drop the animation from the Project panel (under the Controller when the fold-out is expanded) to the state machine in the Animator panel, which creates and initializes the state with the proper name already. When I adjust the Loop Time parameter before or after the drag-and-drop operation, it works well. Does this also work for you? If yes, then perhaps there is a Unity / Mecanim quirk that leads to this problem, as this is not in the hands of the spine-unity runtime to set or query, it's all on Mecanim / Unity side.
User avatar
Harald

Harri
  • Posts: 2091

Jamez0r

Hey Harald! Thanks for the reply.
Harald wrote:
I then made some changes in Spine, exported it, and updated the Spine Asset in Unity. The animation events were gone.

Is this intended? Should I not use events in unity's Animation, and only use events I set within Spine?
Actually the main intended workflow is to setup events within Spine. Would this be a useful or crucial workflow to add events via the Animation panel? We thought that since it does not show any animation context, precise placement of events would be very cumbersome, or do you think otherwise?
Now that I think about it, you're totally right. Not only does it not show any animation context, but if you change your animations and re-import them (potentially changing time-lengths, etc), then the Events that you had created would be out of place.

I'll switch to only using Spine's events.
Regarding the loop problem:
This is strange indeed, I usually always drag-and-drop the animation from the Project panel (under the Controller when the fold-out is expanded) to the state machine in the Animator panel, which creates and initializes the state with the proper name already. When I adjust the Loop Time parameter before or after the drag-and-drop operation, it works well. Does this also work for you? If yes, then perhaps there is a Unity / Mecanim quirk that leads to this problem, as this is not in the hands of the spine-unity runtime to set or query, it's all on Mecanim / Unity side.
I had not been drag-and-dropping the animation into the Animator (I had been creating an empty state, and then adding the animations). However, I just tested it using the drag-and-drop state creation, and it still doesn't 'keep track' of the changes to the Loop Time checkbox:



It's not the biggest deal (now I know to just make sure I set the Loop Time before creating the state), but could be nice if it could somehow update when you change it
User avatar
Jamez0r
  • Posts: 199

Harald

Thanks for the posting video. What I meant was that if I set the animation to Loop Time = true and then drag and drop the animation, it respects the looping parameter. However, it does not respect the change later once it has been created as an animation state (for some reason I could swear it worked before but I must have been too optimistic).

I just had a look at it, the best thing I can offer for now is the following workaround:
It seems that the state is not updated when the respective animation is changed. Instead of removing and re-assigning the animation, you can also set the Tag property to anything, the modification will trigger an update.

Unfortunately this workaround is the best one I currently can offer, I will get back to you if I find anything new out or could resolve the problem cleanly.

---

We can happily announce that the reported problems regarding Loop Time not being updated are now fixed. :cooldoge:

Updated 3.8 spine-unity unitypackages are available for download here as usual:
Spine Unity Download
User avatar
Harald

Harri
  • Posts: 2091

Jamez0r

Woohoo!
User avatar
Jamez0r
  • Posts: 199


Return to Unity