[Solved] Animation channel bone priority instead of channel index

Why are animation channels priorities set based upon the creation order?

For example, let’s say I want to play two animations on two different animation channels. The first channel calls the method addFromRootBone with the root bone whilst the second channel calls it with the right shoulder. If I play a basic stand (breath) animation on the first / root bone channel, it overwrites the second channel even though its bones are more specific than the first one only the because of the animation channels creation order.

Is there a good way to deal with this without having to “hijack” the AnimControl class or to get around it? I feel like it’s not good programmation to just try to swap animation channels within the animation control.

Can you not just create your 2 channels and not add the same bones to both? This is how I control my character who’s arms act differently to the body depending on the weapon they carry. It doesn’t know something is more specific.

I mean, I would prefer a priority system. In our game, there’s always a basic animation playing on all bones, be it breathing, idling or something like that. Having an AnimChannel for each bone is a complete waste of resources if simple animations are played.

My solution was to change the source code in the AnimControl and add an insertion sort to move the items with the most priority at the beginning of the list.

1 Like

There is a complete rework ongoing for animations that will be released in 3.3. So AnimControl will not be changed and will be deprecated on next release.
For now patching it might be your best option.

1 Like