Thanks for sharing your thoughts. I'm answering here instead of replying to your mails so that others can participate in the discussion as well.
foriero написалDidn't know about AnimationRefereceAsset.
Oh, ok, I assume the example scene Spine Examples/Getting Started/3 Controlling Animation Continued
didn't exist when you started using spine-unity years ago, as it demonstrates it rather early in the list of example scenes.
foriero написал
Much cleaner and only one file in repository instead of thousands of individual animation references files.
[..]
Harald, is there a reason why spine animations assets are not grouped into one master asset? We have thousands of animations and if I use what you suggest then our project have thousands of files added. :-( Moreover if you group them into master asset it can simply live next to skeleton data file. And if people need to do their own assets they will create custom master asset and add there SpineAnimationAsset and reference them from there.
The main reason is that these assets have already been generated this way in earlier spine-unity versions, and changing the structure always comes with additional effort to ensure automatic updates without breaking existing projects. Unfortunately there are currently too many far more important tickets remaining, whereas users would not benefit much from this feature (subassets at a single asset file vs. assets in a subfolder).
Thanks, we are aware of this functionality :nerd:. It is currently used for the Mecanim clips which are nested below the generated Mecanim Controller asset (and 5 other locations in the spine-unity code).
foriero написалWhat I propose have SpineAnimationAssetGroup and SpineAnimationAsset. Generate it automatically when importing. Since this way we have only one file it is not a problem to do so. Does it make sense?
foriero via email написал
If this bank can be created and updated automatically I think it will help a lot the animation workflow in Unity.
It seems as if you have reimplemented part of the functionality already provided by SkeletonData.
When I suggested using the SetAnimation()
overload variant taking the Animation object parameter I mainy meant that you should be caching and re-using an Animation object, which SkeletonData.FindAnimation(animationName)
returns instead of implicitly calling FindAnimation()
every time.
So I would suggest using the name strings to setup your assets, but in your code you should resolve them to a cached Animation object once at e.g. Start()
. I currently don't really see any benefit in a SpineAnimationAssetGroup
class with additional methods, but if you have some other use case in mind, please let us know.
This new discussion is continued on this forum thread, with a more suitable topic name:
AnimationReferenceAsset improvements discussion