www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: AGP on September 10, 2011, 12:03:28 am

Title: Animation Blending isn't working.
Post by: AGP on September 10, 2011, 12:03:28 am
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.
Title: Re: Animation Blending isn't working.
Post by: AGP on September 10, 2011, 12:14:31 am
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.
Title: Re: Animation Blending isn't working.
Post by: raft on September 10, 2011, 02:25:48 pm
to enable animation blending you should switch off auto apply animation.

call once
Code: [Select]
animatedGroup.setAutoApplyAnimation(false);
then on each frame
Code: [Select]
animatedGroup.animatePose(..);
animatedGroup.animateSkin(..);
animatedGroup.applyAnimation();
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 07:47:25 am
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.
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 07:03:07 pm
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.
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 08:22:21 pm
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.
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 08:24:06 pm
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.
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 08:45:06 pm
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).
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 08:50:42 pm
Does applyAnimation() hold until it's finished applying?
What do you mean?

Why don't you try decreasing animation index increment per frame?
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 09:12:14 pm
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.
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 09:13:15 pm
what do you mean exactly by "choppy" ?
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 09:41:18 pm
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.
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 09:49:04 pm
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)
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 09:57:24 pm
mabe you have too few keyframes in your animation. exact position is interpolated between keyframes, so that may effect how it looks too
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 10:19:59 pm
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.
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 10:26:04 pm
i don't have an exporter ;)

OgreMax has a setting to control how many keframes are exported
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 10:31:32 pm
Yes you do: ogre-bones.

Do you mean the "optimize skeleton animation" setting? But still, the result shouldn't be choppy, just weird.
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 10:40:38 pm
no I don't. It's just a transformation of format. No keyframes vertices etc. is modified in process.

I can't remember the exact setting but it must be something like keyframes per second
Title: Re: Animation Blending isn't working.
Post by: AGP on September 11, 2011, 10:54:23 pm
It's still a proprietary format. I speak English and this is a semantics discussion. I say exporter, you say something else. We're both talking about the same thing.

I'll check. If I find something of the sort I will add to the wiki.
Title: Re: Animation Blending isn't working.
Post by: raft on September 11, 2011, 11:48:43 pm
I agree that it's a semantics issue. But my point is Bones does not change any structure. You get what you export
Title: Re: Animation Blending isn't working.
Post by: AGP on September 26, 2011, 07:35:12 am
For whatever it's worth, I couldn't get it to run smoothly at 40+ fps. Setting OgreMax to 30 fps may have helped a little (I'm not sure), but perfect it isn't. And at 40+ frames per second, it should look smooth.