Hey Harald, I just noticed this thread, probably would be worth pinning.
Since I made a post regarding an issue with AnimationReferenceAsset, I'll chime in.
I have a problem with the Initialize function, it's quite an edge case, but if I have a timeline track that references a legacy skeleton that's an old 3.8 skeleton after upgrading to 4.0, GetSkeletonData will return null, resulting in a NullReferenceException in this line:
this.animation = skeletonDataAsset.GetSkeletonData(AnimationReferenceAsset.QuietSkeletonData).FindAnimation(animationName);
The consequence is that it's no longer possible to even open and edit the timeline to fix it, as the error just prevents the timeline from loading.
Adding a null check after GetSkeletonData fixed it for me:
this.animation = skeletonDataAsset.GetSkeletonData(AnimationReferenceAsset.QuietSkeletonData)?.FindAnimation(animationName);
I'll add a comment in the github issue.
On to some other remarks regarding ReferenceAsset workflow, all mostly related to unity Timeline, which is my main way of working with ReferenceAssets
1) Renaming animations:
One of the big problems I have is that if for any reason my animator renames an animation in their spine project, this will generate a new ReferenceAsset, which will cause my timelines to break. So I have to tell my animators to never ever change animation names.
I think one way to fix this would be to have some sort of GUID generated in the json when an animation is created, and if an animation is ever renamed, the GUID stays the same.
Now in Unity, there's obviously going to be some work to be done when doing the import, because if you just generate a new ReferenceAsset, it will have its own asset ID within Unity, and the references would still be pointing to the old, obsolete, ReferenceAsset. I suppose one way to do this would be to check for each animation if there's already a ReferenceAsset with the same GUID, and if there is, it would rename the old file and update it (probably with a warning message).
Doing this should, I think, allow unity to keep referencing the proper newly named ReferenceAsset.
2) Selecting an animation clip in unity Timeline
If I need to reference an animation for a specific skeleton in a monobehaviour, I can use the [SkeletonAnimation] attribute and get a nice dropdown list of animations. Super simple.
However it's not as simple in unity Timeline. If I want to directly change the animation from the clip, I get a list of all referenceassets in my project.
The easiest way right now is to browse my project view and drag + drop the proper reference. That's ok but it takes me some extra time to do so. If instead of this:
I could get this:
I believe it would significantly improve my workflow.
I do realise though this may not be a simple thing, as timelines have a different scope than monobehaviours.
Another solution to speed up my workflow would be to rename all my animations so that their names are structured as <skeletonName><animationGroup><animationName>, which is something I've started asking of my animators. This would at least speed up the search in my project, but I can't rename existing animations (see point 1)
3) visualizing animation events in the timeline:
this one is to be put in the "could be nice, definitely not a priority" category. I'm making extensive use of animation events for all kinds of stuff, but sometimes I want to synchronize stuff that is happening in my timeline with an event that is raised in the animation. Right now the way I do it is to roughly estimate, from the animation preview, where that event happens. It's generally not too much of a problem if there's a clear visual cue from the animation itself. But sometimes the approximation is not great and I have to double check with my animator to ask him when exactly I should do it. If there was some visual indication within the clip (a vertical purple line or something like that) that there's an event (doesn't need to tell me the name of the event) that would be cool.
Another option would be to have a right-click to generate signals wherever there's an event on the clip.