Seanba / Aseprite2Unity

Import Aseprite files to Unity
MIT License
48 stars 10 forks source link

Animator Override animation references messed up on re-import/re-apply #8

Closed aschearer closed 2 years ago

aschearer commented 2 years ago

Any time I reimport or change settings and apply them my animator's animation references are messed up. They appear good but don't play in game. Re-linking the animations fixes the issue. I suspect this may be due to the fact that the animations are created anew each time? Happy to dig further but could use a pointer.

Seanba commented 2 years ago

Hi there, @aschearer. I think I'm seeing that error too. Are you saying that you have to reset the Motion filed on an Animator state each time the sprite is re-imported?

I'll take a look but bear with me as I get spun up. It's been a while since I looked at this project. I figured an automatic importer for Aseprite files would be much more useful or popular but it doesn't get many downloads.

Seanba commented 2 years ago

Hi again, @aschearer. Can you tell me which version of Unity you are using?

Seanba commented 2 years ago

Sorry for all the messages, @aschearer, but can you try something? Instead of re-linking all the animation clips after making a change to your aseprite can you try closing and restarting Unity? In my case that "fixes" things for me. I'm not saying that will be the proper solution to this but it may be a clue of what I can do to provide a more robust fix.

aschearer commented 2 years ago

I wonder why more people don't use it, I think this plugin is money 🤑

Are you saying that you have to reset the Motion filed on an Animator state each time the sprite is re-imported? Almost, I'm using an animation override controller, but yes I have to re-assign the overrides:

image

Unity version: 2020.3.25f1 Restarting: ... fixes the issue 🎉 def less severe now.

Seanba commented 2 years ago

Thanks, @aschearer. This appears to be a Unity bug where animation clips created by a custom importer are not properly re-serialized when the custom asset (in this case, the aseprite file) is re-imported. Aseprite2Unity Version 1.1.3 contains a fix for this by forcing the re-serialization to happen.

Let me know if this works for you. Thanks. https://seanba.itch.io/aseprite2unity/devlog/349634/aseprite-version-113

aschearer commented 2 years ago

Yes, that seems to fix it! You're amazing 🙌

Seanba commented 2 years ago

Right on. Thanks, and good luck with your game.