How to reset animation on channel


I can see that Animchannel has a reset methoid but it is package level, not public

so I cannot see any way to set back animation to null.

Idea is to have a top channel, which control the top body and when I use a weapon, I just set top channel anim to bash for instance, so I can still have my walk animation on the global body, and the attck anim for arms.

and once anim is done, I just reset channel, so my global channel keep updating all bones, and top channel go silent waiting for next attack.

is there a specific reason why reset cannot be made public?

Or is there a smarter way to do set animation on a channel back to null?

in advance thx


just guessing here, but if you are using an AnimEventListener maybe you could use onAnimCycleDone() to match the channel the arm bones are on to the same animation that the rest of the bones are using.

kind of like the example in TestWalkingChar.

Look at TestOgreComplexAnim it uses multiple channels and multiple animations on the same skeleton.

Thx for the answers.

@decoy, yes that is what I am currently doing, set the arms channel in sync with the full channel.But I found it ugly to do.

@nehon, I used that one to create my channels, ie adding some bones to my ‘armchannel’ but I doint see in it a way to just silent a created channel once you set its first anim, except by synchronizing all channels like decoy said.

I was just wondering if we could just set back a channel to dormant state, as if it dows not exist. Reset method on Animchannel seems to be what I need , but is package protected.

there is no way to “remove” an animation from a channel, because usually there is always an idle animation. So instead of reseting the anim, you should set a “idle” anim on the channel.

fair enough.

Thx for your time.