Skeletal Animation Blending

When I am blending animations it seems that it tries to blend the existing animation to the bind position and then to the new animation.



Is this correct?



If it is would there be a way that I can set the bind postion in JME or would I need to rig the model in the bind position I want?

Normally it shouldn’t… Can you maybe post a test case for this or at least a video?

Normen



At the beginning of the video you will see the model in the bind position.



I then start an animation that is actually standing with hands in 1 position.

Then I start a new animation which is also standing with hands in a different position.



I get a clapping effect that should not be happening. Then hands and arms should just go up and down to the 2 positions.



http://youtu.be/duqZqBAJo4whttp://youtu.be/duqZqBAJo4w



I am starting the animations using a keypress in this example.

[java] private AnalogListener startAnimations = new AnalogListener() {
public void onAnalog(String name, float value, float tpf) {
if (name.equals("Horns Up")){
channel1.setAnim("trumpet.horns up",1f);
channel1.setLoopMode(LoopMode.Loop);
}
if (name.equals("Horns Dwn")){
channel1.setAnim("trumpet.horns up",1f);
channel1.setLoopMode(LoopMode.Loop);
}
}
};[/java]

Somehow the link isn’t right…

Try this one

http://www.youtube.com/watch?v=duqZqBAJo4whttp://www.youtube.com/watch?v=duqZqBAJo4w



http://www.youtube.com/watch?v=duqZqBAJo4w

Hm, can you reproduce this with one of the test models somehow? Are you sure the keyframe ranges of your animations are correctly set? Which importer do you use?

Here is a test case using OTO.



If you press U or Y it will start the animation. If you look at him it looks like he bounces. I would assume he would stay the same with no movement since you are going to the same location.



[java]public class Main extends SimpleApplication {

private AnimChannel channel1;

private AnimControl control1;



public static void main(String[] args) {

Main app = new Main();

app.start();

}



@Override

public void simpleInitApp() {

// setPauseOnLostFocus(false);

Node model = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");

rootNode.attachChild(model);

control1 = model.getControl(AnimControl.class);

channel1 = control1.createChannel();



DirectionalLight sun = new DirectionalLight();

sun.setDirection(new Vector3f(0f, 8f, -50f).normalizeLocal());

sun.setColor(new ColorRGBA(1f,1f,1f,1f));

DirectionalLight sun1 = new DirectionalLight();

sun1.setDirection(new Vector3f(0f, 8f, 50f).normalizeLocal());

sun1.setColor(new ColorRGBA(1f,1f,1f,1f));

DirectionalLight sun2 = new DirectionalLight();

sun2.setDirection(new Vector3f(-50f, 8f, 0f).normalizeLocal());

sun2.setColor(new ColorRGBA(1f,1f,1f,1f));

DirectionalLight sun3 = new DirectionalLight();

sun3.setDirection(new Vector3f(50f, 8f, 0f).normalizeLocal());

sun3.setColor(new ColorRGBA(1f,1f,1f,1f));



rootNode.addLight(sun);

rootNode.addLight(sun1);

rootNode.addLight(sun2);

rootNode.addLight(sun3);

setupKeys();

// You must add a light to make the model visible

}



@Override

public void simpleUpdate(float tpf) {

//TODO: add update code

}



@Override

public void simpleRender(RenderManager rm) {

//TODO: add render code

}

private void setupKeys() {

// You can map one or several inputs to one named action

inputManager.addMapping("Horns Up", new KeyTrigger(KeyInput.KEY_U));

inputManager.addMapping("Horns Dwn", new KeyTrigger(KeyInput.KEY_Y));

// Add the names to the action listener.

inputManager.addListener(startAnimations, new String[] {"Horns Up", "Horns Dwn"});

}

private AnalogListener startAnimations = new AnalogListener() {

public void onAnalog(String name, float value, float tpf) {

if (name.equals("Horns Up")){

channel1.setAnim("stand",1f);

channel1.setLoopMode(LoopMode.Loop);

}

if (name.equals("Horns Dwn")){

channel1.setAnim("stand",1f);

channel1.setLoopMode(LoopMode.Loop);

}





}

};

}[/java]

1 Like

I created a Ogre XML file from 3DS Max and then I converted it inside the JMP by right click and converting it.



My keyframes are very similar to the stand animation in the OTO model.











P.S.

On a side note and a separate issue when listening for AnimEvents the event onAnimCycleDone repeats endlessly.



I do not know if this is an issue or not, just thought I would report it.

Was there anything else I can provide to clarify this issue?

No, thanks, this should provide helpful. Maybe @Momoko_Fan can tell you if and how this behavior is intended or can be changed.

I was able to reproduce the issue, however it doesn’t seem to occur with the walk animation. I believe its caused due to the animation having a length of 0 seconds.

I have been able to repeat this issue if I have an animation that has a length example 1 - 10 second duration but no movement as well.



For example a standing animation that has a duration of 1 sec.



Also I have experienced an issue where I have an animation with a duration of 1 second and the upper body performs an animation but the legs do not. I get movement on the legs during the upper body animation. Even though the lower body is doing nothing.

@dm1056 said:
Also I have experienced an issue where I have an animation with a duration of 1 second and the upper body performs an animation but the legs do not. I get movement on the legs during the upper body animation. Even though the lower body is doing nothing.

Does it still happen if there are bone tracks on the lower body bones during that animation?

Yes I still have the issue when the bones are tracking.



See in this example video. I am blending the walking animation over 1 second. You can see when the animation is blending by the hand movement. You should also notice that the legs spread during the blend.



http://www.youtube.com/watch?v=OZzXcPeDT4Ehttp://www.youtube.com/watch?v=OZzXcPeDT4E



It seems that the blending is interpolating the points from the location on the first animation to the bind locaiton and then to the new animation location location.

I will see if I can create the same issue with OTO.

I have been unable to to create a visible reproduction using oto or the ninja. I believe this is because their bind locations are so close to the action paths that you are unable to see any incorrect movement.



Please let me know if there is anything that I can provide to help troubleshoot this issue.

Can I provide any additional information to help clarify the issue?

From the looks of it, the issue happens because we blend from bind pose to the animation over the weight, so in certain cases it might not work. A better way would be to set on the first weight and then blend on subsequent weights, I haven’t gotten around to implementing that method of blending yet.