Animation and Bones

Hello all,

I am making an action-adventure/RPG in Panda3d and almost everything with Panda3d so far seems really awesome, I’m loving the workflow. However there is one thing I’m still concerned with which is animation.

What is the accepted way to do animations using Blender into Panda3d? I have read that .egg files need every single animation frame to be a “keyframe” and that there is no interpolation between frames. This seems very bad as it makes the animations take up vastly more memory than they should, because only the keyframes and interpolation data is really needed. Plus, it disallows for the animations to change their speed, by adding or removing frames from the animation. Finally, this is also a hassle to do, while exporting animations to .egg files.

So, this is not acceptable for me. I need a way to do animations without having to store every single frame. So what I’ve decided is to use “bones” or skeletal animation. If this is not really supported by Panda3d, that could be fine as I could probably write my own bones scripts and create the animations in-code, altering the transforms of each joint node along certain timers. But this is also not ideal, as it would be much easier to make the animations in Blender and export them, but again we come to the keyframe issue.

What should I do to solve this problem and create animations in the most efficient way while also being efficient in terms of memory/storage? I cannot have my models be 100x larger in storage size just because Panda3d doesn’t support proper animation, so what can be done to circumvent this?

Let me know if there is any additional information I can provide to clarify. Thank you so much for reading, I look forward to what you have to say.

Skeletal animation is already supported. Frame interpolation is also supported, but you have to keep your frame step the same along the animation. You aren’t limited by frame rate, so you can make 60 or 30 frames per second animations. Panda3D can interpolate your animation rate up to rendering frame rate. You can also scale the playing speed of the animation without moving keyframes.

It actually mean that you can’t skip a single keyframe in the animation, so you have to keep your frame rate constant. If you aren’t happy with that, then you have to make your own interpolation between keyframes.

1 Like

Thanks for your reply! That’s really great to hear, I guess I misunderstood or this is no longer a problem.

To clarify though, what do you mean we have to keep the framerate constant? Like you can’t have the game switching from 30 to 60fps? Or it can’t dynamically change fps in runtime like as performance requires it?

So what is the basic process of exporting an animation from Blender for use in Panda3d? I’m using YABEE currently. Is there anything special we have to do to set it up for use by Panda3d?

Thanks!

I mean that if you are making 20 fps animation, then the time between keyframes have to be constant, like 50ms for 20fps animation, for example. So you can’t skip 1 keyframe in between and interpolate 100ms.

The game frame rate is not related to animations frame rate. So you can render game in 120 fps with 30 fps animations, for example.

1 Like

No special setup is required. YABEE can use Blender’s interpolation to save keyframes.

1 Like

Ok, great! Thanks for that, you’ve saved me a lot of unnecessary work. :slight_smile:

I’m not sure that I’m reading you correctly here: I’m pretty sure that I’ve had skeletal animations with varying numbers of frames between keyframes, and then altered the in-game play-rate of the resulting animations, all without (apparent) trouble. Or is there some other issue that I’m not aware of…?

As far as I know EGG animations are just list/array of frames (bone matrices) and animation frame rate is stored as an integer. So there is no such thing as keyframe, because it’s not possible to skip frames. YABEE can make missing frames in between of Blender keyframes while exporting.

Yes. You can still change the frame rate, because again EGG animation is just array/list of frames, which you can switch at any speed.

Ah, fair enough–I wasn’t aware of that! Thank you for clarifying. :slight_smile: