I found the reason of problem which I described in my previous post. This problem can occurs in any animation that doesn't save all parameters.
Picture below shows "jump" animation:
Loading Image
There is rot.Rotate parameter saved in this animation. However "walk" animation doesn't has this parameter.
That's why when "jump" animation switch to "walk" animation, "walk" gets random rotation parameter from previous "jump" animation.
It can be repaired by forcing to save all parameters (rotation, scale, translation).
It's also possible to add missing timelines.
In "SkeletonJson.cs" I added a few lines of code to repair missing RotateTimeline.
//******
private Dictionary<BoneData, Dictionary<Timeline, object>> BoneDataLib = newDictionary<BoneData,Dictionary<Timeline, object>>();
//******
//******
// BoneDataLib = new Dictionary<BoneData, Dictionary<Timeline, object>>();
BoneDataLib.Clear();
for (int x = 0; x < skeletonData.Bones.Count; x++)
{
BoneData b = skeletonData.Bones[x];
if (BoneDataLib.ContainsKey(b) == false)
{
BoneDataLib.Add(b, new Dictionary<Timeline, object>());
}
}
//******
//******
BoneData OrginalBone = skeletonData.Bones[boneIndex];
BoneDataLib[OrginalBone].Add(timeline, timeline);
//******
//******
foreach (KeyValuePair<BoneData, Dictionary<Timeline, object>> val in BoneDataLib)
{
Type t = typeof(RotateTimeline);
bool ValNotExist = true;
foreach (KeyValuePair<Timeline, object> lin in val.Value)
{
if (lin.Value.GetType() == t) { ValNotExist = false;}
}
if (ValNotExist)
{
RotateTimeline tlrot = new RotateTimeline(2);
tlrot.SetLinear(0);
tlrot.SetFrame(0, 0, val.Key.Rotation);
tlrot.SetFrame(1, duration, val.Key.Rotation);
tlrot.BoneIndex = skeletonData.FindBoneIndex(val.Key.Name);
timelines.Add(tlrot);
}
}
//******
Below I put link to modified file "SkeletonJson.cs".
http://center.nstrefa.pl/spine/SkeletonJson.cs