• Runtimes
  • Updating existing animations in Unity from Spine

Hello,

So in a Unity project I'm involved in, we have Spine animations hooked up in unity operating 100% the way we want them to.

However, as the animator for most assets in game, I like to go back and update\tweak animations that have already been implemented in Unity. We replace the existing json and atlas files, reload animations in unity and get mixed results after that. Sometimes it works, sometimes it doesn't work.

9/10 times the material file magically disappears for no reason what so ever as soon as our player engine plays an animation from any state.

Is there any reason this should be happening?

Any and all assistance and advice is greatly appreciated.

Related Discussions
...

This shouldn't be happening, at least I haven't heard about it happening before. Unity does seem to be a be fidgety when it comes to updating files though, have you tried refreshing manually before playing? I don't think this is a Spine error, but more likely Unity acting up. Maybe Mitch can shed some light on it ?

Hi, thanks for the timely responses Shiu, however, this is definitely due to Spine's unity runtime, I'm just not sure what is causing it. What is the correct way to update an existing animation which has been exported from spine into unity? I have been unable to find any documentation or videos on how to go about this.

Who is Mitch? The site states that this forum is the correct channel to get support from Esoteric, is there a particular forum member we need to pm in order to get support?

Thank you!

Mitch is the one who made most of the current Unity runtime, he roams this forum and often replies to Unity threads 🙂 You're welcome to try and send him a PM to see if you can get his attention.

1 个月 后

I'm using unity as well and got the same issue, is there anyone that can help with this?

All I want to do is update existing animations that I exported. There's no documentation or resources on this.

What do? :bang:

missed this thread :x sorry

can someone provide precise repro steps and maybe even example files to show the issue? would be happy to resolve

Mitch :

missed this thread :x sorry

can someone provide precise repro steps and maybe even example files to show the issue? would be happy to resolve

Hi Mitch,

Thanks for helping with this, I believe you wrote the unity-runtime? I was rather disheartened to learn that the unity-runtime wasn't created by esoteric despite the unity logo appearing on the site (implying that it is officially supported), considering this is a commercial product. None the less, thank you for writing the runtime, otherwise I wouldn't be using it with unity at all!

I've really been banging my head against the wall with this, the situation is as follows:

  1. In unity I have spine-csharp, spine-unity and SpineData.

  2. In the spine data folder I currently have playerCharacter.atlas.txt, playerCharacter.atlas and playerCharacter.json

  3. In the hierarchy I have a gameobject named "Player" with the spine logo next to it, from when I first imported from spine, along with extra scripts and components on it

  4. Currently everything is working and I can move the character around and the correct animations play

Now I would like to update this existing character from a new export from Spine that has had changes made to it, and this is the part that has left me in tears.

I've tried:

  1. dragging and dropping playerCharacter.atlas & playerCharacter.json into spine

  2. dragging and dropping playerCharacter.atlas.txt & playerCharacter.json into spine

  3. replacing the existing files on disk via explorer

At worst I get the error "Atlas not found", at best I get no errors but when I run the game the character disappears when moving from idle animation to the moving animation. The results seem completely intermittent, what works one day will not work the next.

Spine is a wonderful product, but honestly the export/import part for unity is driving me up the wall :bang: :broken:

There is no documentation on this (unless I've somehow missed it?), and the entire process seems extremely vague so I can't really tell if I've screwed up completely or if the import processes is just very unstable.

If I could just get a simple explanation of how to correctly export from spine into unity, as well as how to import updated animations once I've made changes to the animation, I would be eternally grateful.

Do you have skype? Somethin sounds fishy to me heh. Would be glad to talk/walk thru it with you via screenshare or some such.

Skype: Fenrisul

Mitch :

Do you have skype? Somethin sounds fishy to me heh. Would be glad to talk/walk thru it with you via screenshare or some such.

Skype: Fenrisul

Thank you for the offer, but I don't think it would be possible at the moment as I'm on a rather weak wifi connection.

What if I scrap everything, and start from scratch? Would you be able to direct me in how to properly export from spine, into unity, step by step, and then also set it up so that I can regularly export updated animations into unity?

My end goal here is to have a quick and easy process setup so that I can export from spine into unity on the fly, and see the updated animations in unity without any hassle.

Thanks for the help! :yes:

GamesByNight :
Mitch :

Do you have skype? Somethin sounds fishy to me heh. Would be glad to talk/walk thru it with you via screenshare or some such.

Skype: Fenrisul

Thank you for the offer, but I don't think it would be possible at the moment as I'm on a rather weak wifi connection.

What if I scrap everything, and start from scratch? Would you be able to direct me in how to properly export from spine, into unity, step by step, and then also set it up so that I can regularly export updated animations into unity?

My end goal here is to have a quick and easy process setup so that I can export from spine into unity on the fly, and see the updated animations in unity without any hassle.

Thanks for the help! :yes:

Sure. Lemme make a quick youtube video of my regular workflow.

Mitch :

Sure. Lemme make a quick youtube video of my regular workflow.

Awesome, thanks so much! :clap:

Whenever its done processing it'll be up.

There's a little bit of a mea culpa in there around 8 minutes when a prefab link broke >.> myyyy baaddddd... will fix it 🙂


I was rather disheartened to learn that the unity-runtime wasn't created by esoteric despite the unity logo appearing on the site (implying that it is officially supported), considering this is a commercial product. None the less, thank you for writing the runtime, otherwise I wouldn't be using it with unity at all!

Oh yea, to reply to this heh - I only improved what was already there. Particularly the import process and the Skeleton Utility toolset are my handy work - and various bug fixes here and there. Esoteric (Nate) is responsible for the rest of it though. It definitely worked before I got here. I just made it better. :smirk:

Mitch :

Whenever its done processing it'll be up.

There's a little bit of a mea culpa in there around 8 minutes when a prefab link broke >.> myyyy baaddddd... will fix it 🙂

This is amazing, thank you so so much! :rofl:

I'm going to have to restructure a few things to fit your workflow, but I'll update once I have! Being able to just hit export after making changes and have unity reflect it is going to increase my quality of life a thousand fold!

One question I do have given your workflow, once you have a prefab eg: your mage (which looks great btw), how do you go about adding eg: a movement script? I assume that adding the script directly to the prefab will cause issues with the exporting/updating?

Mitch :

Oh yea, to reply to this heh - I only improved what was already there. Particularly the import process and the Skeleton Utility toolset are my handy work - and various bug fixes here and there. Esoteric (Nate) is responsible for the rest of it though. It definitely worked before I got here. I just made it better. :smirk:

My mistake, I didn't realize that esoteric had done initial work, but in any event I think you should be getting a cut of the sales from all the great work you've been doing!

Thanks again for all your help with this, you're my hero!

One question I do have given your workflow, once you have a prefab eg: your mage (which looks great btw), how do you go about adding eg: a movement script? I assume that adding the script directly to the prefab will cause issues with the exporting/updating?

I'm going to fix that soon. For now just don't use the default prefab by spawning a gameobject by right clicking on the Skeleton Data Asset and choosing Spine


Spawn. Prefab the resulting game object as something else other than the auto-generated one and it'll be safe.

Mitch :

I'm going to fix that soon. For now just don't use the default prefab by spawning a gameobject by right clicking on the Skeleton Data Asset and choosing Spine


Spawn. Prefab the resulting game object as something else other than the auto-generated one and it'll be safe.

I'll avoid rightclick->Spine->Spawn, but please bear with me, but I don't follow 100%. In your video when you export a prefab is automatically created, which you drag onto the hierarchy. Once I've done this can I then start adding scripts and other components on to that object in the hierarchy and save my project like that, or do I have to prefab the object once I've added my scripts, or do I have to do something different like make the spine prefab a child of my player object?

Thanks again for the help! :yes:

GamesByNight :
Mitch :

I'm going to fix that soon. For now just don't use the default prefab by spawning a gameobject by right clicking on the Skeleton Data Asset and choosing Spine


Spawn. Prefab the resulting game object as something else other than the auto-generated one and it'll be safe.

I'll avoid rightclick->Spine->Spawn, but please bear with me, but I don't follow 100%. In your video when you export a prefab is automatically created, which you drag onto the hierarchy. Once I've done this can I then start adding scripts and other components on to that object in the hierarchy and save my project like that, or do I have to prefab the object once I've added my scripts, or do I have to do something different like make the spine prefab a child of my player object?

Thanks again for the help! :yes:

Opposite. DO NOT use the automatically created Prefab. DO use Rightclick -> Spine -> Spawn. Add your scripts. Create a new prefab ( do not overwrite the automatic one ).

I'll fix this soon.

Also, I've been working on a full character controller tutorial for Spine Unity with my concept of best practices. Will definitely release that with full source in the official runtimes as an example when its ready.

Mitch :

Opposite. DO NOT use the automatically created Prefab. DO use Rightclick -> Spine -> Spawn. Add your scripts. Create a new prefab ( do not overwrite the automatic one ).

I'll fix this soon.

Also, I've been working on a full character controller tutorial for Spine Unity with my concept of best practices. Will definitely release that with full source in the official runtimes as an example when its ready.

Thanks for clearing that up, the character controller sounds great, I've managed to get everything I needed working in my scripts but would love to see some best practice examples.

Once again, thank you so much for all the patient help!

This is amazing, thanks Mitch. Quite legendary.