In short, sometimes editing animations in spine editor requires to apply different hairstyles to animation to check how they behave after the animation was edited. And occasionally artists forget to remove the applied hairstyle, which leads to animation enforcing this hairstyle needlessly, ignoring slots overwrites done via code.
Of course it can be fixed by reporting about this issue to the artist, or by manually editing the json (which I'd like to avoid), but it would be faster to bypass this issue for hairstyles slots (and only for them) once and for all. Since we will never need animations to enforce certain hairstyles anyway.
At first I hoped to edit animations during runtime to remove unneeded attachments from them, but seems like API doesn't support such things.
So currently I solved it via editing spine importing code, replacing
if (timelineName == "attachment") {
var timeline = new AttachmentTimeline(values.Count);
timeline.slotIndex = slotIndex;
by
if (timelineName == "attachment") {
if (!slotName.Contains("hair")){
var timeline = new AttachmentTimeline(values.Count);
timeline.slotIndex = slotIndex;
in SkeletonJson.cs. The only drawback of this is that I will need to edit it again after spine runtime update π