Animation not properly blended

My model has a basepose where its rootbone is around 0/0/0, the animation frames all adjust the height of the rootbone while in animation.

The current animation code does not blend the animations correctly as one would expect. While bending it seems only part of the translation from blendFrom is used and only a part of animation in AnimChannel, but these parts do not add up.

The result is the model starts to move down and then moves back up, until no more blending is used (where it stays in the higher position), so the models height moves between basepose height and animated height.

I am not 100% sure why it has to be done this way, but I had a look in the jme2 code and it was done similarly. Anyway, with the fix below my model just blends between the previous animation an the new, and not between half of the previous and half of the new…




— (revision 8050)

+++ (working copy)

@@ -321,7 +321,7 @@


if (blendFrom != null){

  •        blendFrom.setTime(timeBlendFrom, 1f - blendAmount, control, this);<br />
  •    	blendFrom.setTime(timeBlendFrom, 1f, control, this);<br />

//blendFrom.setTime(timeBlendFrom, control.skeleton, 1f - blendAmount, affectedBones);

timeBlendFrom += tpf * speedBlendFrom;

timeBlendFrom = clampWrapTime(timeBlendFrom,