Simple Keyframe Animation Example

Hi guys,
since more and more people don’t come along with animations in Blender and YABEE, here’s an example.

For this I’ll use this wonderful model by SKY_D:
blendswap.com/blends/archite … -doorgate/

Now here are all steps required to animate the door and get it running in Panda:

  • Open Blender and install the right version of YABEE. You can find informations about how to do that in the YABEE thread here on the forums.
  • Open the blend you should get from the link on top.
  • Remove everything from layer one, since these parts are hi-poly.
  • Go to layer two.
  • Select an object, go to its modifiers and apply the mirror modifier.
  • Do that for the other objects as well, so that none has any modifiers on them.
  • Now select any object, switch to edit mode and select everything.
  • Create a new vertex group on this object, name it properly (e.g. “upper_door”) and assign the selected (all) vertices.
  • Repeat the last two steps for all objects.
  • Select all three objects (upper door, bottom door part and frame) and join them (ctrl+j). Now you’ll only have one single object with all meshes inside.
  • Create a new armature (shift-a, add armature>bone).
  • Go to edit mode with the armature and duplicate the bone. Move both onto particular door parts respectively. You’ll need one for each moving part.
  • Select a bone and change its name to the name of the vertex group it should control. E.g. “upper_door”. Do that for both bones.
  • Back in object mode, select the armature and uncheck the option “envelopes” in the armature settings panel.
  • Select your door object.
  • Add a new armature modifier (important: modifier, NOT constraint).
  • Assign the proper armature in the modifier.
  • Unselect the “envelopes” option here as well.
  • Select your armature and switch to pose mode.
  • Select both bones.
  • Press i and select “location” from the menu.
  • Go to frame 40 (on the bottom bar or by pressing the right arrow).
  • Select each bone and move it to the right position it should have when the door is open respectively. E.g. move the upper bone zwo units up the z-axis and the bottom one 2 units down the z-axis.
  • Press i on each bone and select “location”.
  • Now press alt+a to review your animation. You should see the door opening in a loop. Abort the preview with esc.
  • Now select everything in your scene: the door object and the armature.
  • Go to File menu -> export -> Panda3d .egg
  • Select a path to save your egg files in.
  • On the left side in the export view there’s a small animations box, which is empty. Press the + and insert a name for the animation. Also change the end frame from 2 to 40.
  • Export.
  • If no errors occured, go to a terminal.
  • Use pview to see your animation: pview -cl sfdoor.egg -a sfdoor_open.egg
  • Be happy.

The result can be seen here: static.nemesis13.de/animation_example.zip

I hope this helps a few people.