Animation Blending isn't working.

Started by AGP, September 10, 2011, 12:03:28 AM

Previous topic - Next topic

AGP

I thought OgreMax wasn't exporting my pose animations. It turns out that when I DON'T call animateSkin(), animatePose works. But if I do, all I see is the skin animation. Please help.

AGP

By the way, I should note that when I don't call animatePose(), the fps leaps from 36 to 48, so animatePose() is taking its toll on performance but it's not showing any results.

raft

to enable animation blending you should switch off auto apply animation.

call once
animatedGroup.setAutoApplyAnimation(false);

then on each frame
animatedGroup.animatePose(..);
animatedGroup.animateSkin(..);
animatedGroup.applyAnimation();

AGP

Thanks, that did it. I put it up on the wiki, and it should be on the documentation.

Now here's a separate issue: I don't think the animations are being refreshed at the rate of the screen because although I'm getting just over 40 frames per second now, the animation is still REALLy choppy.

raft

Quote from: AGP on September 11, 2011, 07:47:25 AM
I don't think the animations are being refreshed at the rate of the screen because although I'm getting just over 40 frames per second now, the animation is still REALLy choppy.

I didn't understand what you mean here. Animation speed is under your control. It depends on how fast you increase animation index every frame.

AGP

What I mean is that it seems like the animation control runs on a separate thread: at 40 frames per second, it should look a LOT smoother than it does.

raft

Bones does nothing to control animation speed. It's all in application's control. It depends on how fast you increase animation index every frame.

AGP

Does applyAnimation() hold until it's finished applying? Because I really think it should look smoother than it does if the frame rate is to be believed (I'm using Egon's simple HelloWorld counter and it looks perfectly right).

raft

Quote from: AGP on September 11, 2011, 08:45:06 PM
Does applyAnimation() hold until it's finished applying?
What do you mean?

Why don't you try decreasing animation index increment per frame?

AGP

I did, it stays choppy and moves too slowly. Besides, I'm calculating the animation increase relative to the time passed since the last frame.

raft

what do you mean exactly by "choppy" ?

AGP

Choppy is the opposite of smooth. It looks like it's refreshing at under 10 frames per second. 40 frames per second is almost twice as much as film. One character's animation should look perfect, but it doesn't.

raft

mm, but as I said, Bones does not control animation speed. It's all in application's control. try playing with speed (aniamation index increment)

raft

mabe you have too few keyframes in your animation. exact position is interpolated between keyframes, so that may effect how it looks too

AGP

Having too few frames sort of makes sense (that would mean that either OgreMax or your exporter is chopping the animation because in Max it looks perfect). But even then, the interpolation would make it look smooth (if a little odd). And decreasing the increment, as I said, slows it down but doesn't resolve the choppiness.