Hi!
Today, I have update my runtime to latest version on Git (2.5 up from 2.3). Everything was working fine before the update but now my code for mixing animations seems to be broken (code that I did like a year ago). Please, take a look:
void runAnimation(SkeletonAnimation *skeleton, int trackIndex, const string &animation, bool loop, bool mix, float mixTime)
{
string current = "";
spTrackEntry *entry = skeleton->getCurrent(trackIndex);
if(entry != nullptr)
current = entry->animation->name;
if(current == "" || !mix)
{
skeleton->setAnimation(trackIndex, animation, loop)
}
else
{
skeleton->setMix(current, animation, mixTime);
skeleton->setAnimation(trackIndex, animation, loop);
}
}
Currently, it seems that setMix function is not working as intended because it is interpolating between the setup pose and 'animation' instead of doing it between 'current' and 'animation'. I want to clarify again that my code was working prior the update. Please, can you take a look and tell me if this is ok? In case it is working as intended, can you explain me how my code should look?
Thanks in advance!! π
Regards,
fryderyk
Hi again!
I have noticed another rare behaviour after updating.
We have a character that has a run animation (which moves the right arm) playing on trackIndex 0, I will call it "A" animation. When there is some user input, it plays a right arm animation on trackIndex 1, I will call it "B" animation. Before the update, everything was working as I expected. The A animation plays correctly, then a B animation is triggered by user which overrides the A animation for the right arm (because it has a greater index) and when the B animation is finished, the right arm recovers its animation from the A animation.
However, after updating, when B animation finishes, the right arm doesn't keep playing A animation anymore. The arm just keeps the state of last keyframes of B so the right arm doesn't move anymore by A animation. I don't know if the new AnimationState is built to work like that or there is any bug concerning this... like I said in the first post, if the new behaviour is correct, can you tell me how can I reproduce the old one?
Thanks in advance!! π
Regards,
fryderyk