Playing multiple channel animations

Hi all,

I have a question concerning animations with multiple channels.

I have a sinbad model (http://www.ogre3d.org/tikiwiki/Sinbad+Model) that I have exported from blender 2.65 with ogre 0.5.8 that has the RunBase and RunTop on the NlaTrack. When I convert it into a j30 I can run either animation with no problems. When I try to create two channels and run them both only the first channel is played.

The comment for createChannel() says: “Create a new animation channel, by default assigned to all bones in the skeleton.”

I also read this post with the same issue I’m having:
http://hub.jmonkeyengine.org/forum/topic/multiple-animation-channels/#post-182143

It seems as though I need to assign the individual bones two each channel.

However I noticed that Norman didn’t have to do this in his demonstration: “SDK Usecase Demo 1” (http://hub.jmonkeyengine.org/forum/topic/new-sdk-video-tutorial-series)

I downloaded the code and tried it myself. I used his AnimUpdateControl.java on my sinbad and only the top plays but on his Quixote model top and bottom plays.

Is there something that I am missing either in my blender export or in JMonkey?

If needed I can provide screenshots with my sinbad settings and workflow.

Big thanks to the Jmonkey team!

Regards,
Jason

Normen is lucky, or clever, or a bit of both :stuck_out_tongue:
You have to assign the right bones to the channels. That’s the recommended way of doing this. Here you have to assign the top bones from the waist of the skeleton to one and the bottom bones to the other.

The fact that is works without doing this in Normen’s example is probably because of the order he creates the channels and play the animations. I don’t remember which one but, one of the animation doesn’t affect the other set of bones, so there is an order where it works.

1 Like

@JasonCarey

Do not try to use my code in issue topic, its bugged anyway.

It seems as though I need to assign the individual bones two each channel.
true, you need to make something similar to this(it use my extended script that assign bones to channels):

[java]
Set torso = new HashSet();
torso.add(“torso”);
Set head = new HashSet();
head.add(“head”);
Set topBones = new HashSet();
topBones.add(“neck”);
topBones.add(“shoulder_left”);
topBones.add(“arm_left”);
topBones.add(“armend_left”);
topBones.add(“thumb_left”);
topBones.add(“thumbend_left”);
topBones.add(“hand_left”);
topBones.add(“finger_left”);
topBones.add(“shoulder_right”);
topBones.add(“arm_right”);
topBones.add(“armend_right”);
topBones.add(“thumb_right”);
topBones.add(“thumbend_right”);
topBones.add(“hand_right”);
topBones.add(“finger_right”);
Set bottomBones = new HashSet();
bottomBones.add(“Parent”);
bottomBones.add(“belt”);
bottomBones.add(“leg_left”);
bottomBones.add(“leg_right”);
bottomBones.add(“legend_left”);
bottomBones.add(“legend_right”);
bottomBones.add(“feetfront_left”);
bottomBones.add(“feetfront_right”);
bottomBones.add(“feetback_left”);
bottomBones.add(“feetback_right”);
setChannelBones(topBones, 0);
setChannelBones(bottomBones, 1);
setChannelBones(torso, 2);
setChannelBones(head, 3);
setAnim(“idle0”, LoopMode.Loop, 0, idleSpeed, 0);
setAnim(“idle0”, LoopMode.Loop, 1, idleSpeed, 0);
[/java]

to make it work i also have extended “onAnimCycleDone”
[java] public void animCycleDone(AnimControl control, AnimChannel channel, String animName) {
System.out.println(“anim loop end” + channel);
if (animName.equals(“idle0”) || animName.equals(“idle1”) || animName.equals(“idle2”) || animName.equals(“idle3”)) {
System.out.println(“idle loop end” + channel);
randomIdle();
} else if (animName.contains(“Attack”)) {
System.out.println(“Attack loop end” + channel);
randomIdle();
}
}
[/java]

its still hard to synchronize animations when you just want to play one animation for all bones, because then one animChannel must decide to stop other channels, but it work.

1 Like

Ok great thanks for the support!