• Bugs
  • Problem with animation mix in cocos2dx 3.0 beta

Hi,

I have been using spine with cocos2dx 3.0 alpha for the past months and everything works fine.

Recently I have upgraded the project to cocos2dx 3.0 beta, and I found a problem with animation mix.

I have multiple mix with the skeleton animation, while most of it seems to work, but some are not.

Here are the codes:

_spineObject->GetSkeletonNode()->setMix("idle", "running", 0.2);
_spineObject->GetSkeletonNode()->setMix("running", "idle", 0.2);
    
_spineObject->GetSkeletonNode()->setMix("idle", "powerup_wait", 0.2); _spineObject->GetSkeletonNode()->setMix("powerup_wait", "idle", 0.2);
_spineObject->GetSkeletonNode()->setMix("idle", "throw_dice", 0.2); _spineObject->GetSkeletonNode()->setMix("throw_dice", "idle", 0.2);
_spineObject->GetSkeletonNode()->setMix("powerup_activate_2", "powerup_activate_idle", 0.2); _spineObject->GetSkeletonNode()->setMix("powerup_activate_idle", "idle", 0.2);

the mix between powerup_activate_2 and powerup_activate_idle is not working.
I have checked the skeleton.json and the naming is correct.

I look through the spine codes a bit, the mix did get registered when setMix is called.
But when powerup_activate_idle is been called, while powerup_activate_2 is active, it fails to find a valid entry and thus skip the crossfading part.

The codes is the same before I update to cocos2dx 3.0 beta, and it was working fine back then.

Btw, I am using the spine that comes with the cocos2dx 3.0 beta, which is under editor-supprt/spine.
In the spine files it also says Version 1.1

Related Discussions
...
  • Đã chỉnh sửa

Oh, I just thought about something, the difference between powerup_activate_2 to powerup_activate_idle mix and other mix, is that the animation is not loop together.

What I am trying to say is, when I use powerup_activate_2, I doesn't loop it, the animation will finish and pause for a while before I call setAnimation powerup_activate_idle.

8 ngày sau

I'm sorry I can't help with the fork of the Spine runtimes that cocos2d-x has made


I don't know what changes they've made. In the official runtimes, when an animation that does not loop reaches its trackentry's endTime, it is removed from the track. If you later set an animation, the track has no current animation, so there is no mix. To change this, when you set or add your animation, change the endTime on the track entry to be very high.

12 ngày sau

Yes! What you mention above is the problem in the animation mix!

Because when I set the next animation, the previous animation was already done and therefore it cannot find the mix.

We extend the duration of the previous animation longer and the problem is gone!

Thank you so much!