User Tools

Site Tools


public:t-vien-12-1:lab_8_materials

Lab 8 - Character Animation with Blender

This is written for Blender versions *below* 2.5, for a newer (but simpler) tutorial, use Animation Tutorial for Blender 2.6 (Part I) and Animation Tutorial for Blender 2.6 (Part II)

Before You Start

  • You need to have Blender installed on your computer (pick the same version of Python as you are using for Panda 3D if you can).
  • You need to have extracted the contents of the latest Chicken Egg Exporter zip file into your “.blender/scripts” folder.
  • Download and unzip the Lab 8 Asset File into your working directory

Rigging and Animating a Character in Blender for Panda 3D

This lab is based on the excellent Introduction to Character Animation by Ryan Dale, created as part of the Blender Summer of Documentation effort. You will jump right into rigging (creating the armature), so the finished model from the tutorial is being supplied as part of the Lab 8 Assets. You may want to have the Blender QuickStart Guide handy.

  1. Exporting a Model to Panda 3D:
    1. Load the model alien.blender into Blender (this is the same model as the one in Tutorial_body.blend from the tutorial we will be following during this lab, except mirroring has already been applied and the normals have been fixed).
    2. Make sure you can export the model into Panda 3D. You do that by engaging the Chicken Exporter script from the Scripts Window. When you start Blender, the main screen is split into two windows, a 3D view on top and a panel of buttons below. You can change the contents of each of these windows by clicking on the little icon to the far left in the windows. You'll then get a menu of possible window types (see screenshot). Change the lower window into a Scripts Window using this menu. Now in the Scripts Window, select the Scripts → Export → Chicken R56(.egg)… menu item. In the 3D Window, select the model (it should be outlined in pink to show that it is selected) and in the Scripts Window, make sure the export file path is your working directory and press the Export button (notice that you can toggle the pview button in the exporter to get a Panda 3D preview after export has finished - in the preview, press L to turn on the preview light).
    3. Run showalien.py to make sure that your model loads properly into your own Panda 3D python program (notice how the alien is being loaded as an Actor).
  2. Adding an Upper Body Armature:
    Follow the steps in the Upper Body Armature Blender Tutorial, starting with the step called Add Armature and ending with a step called Add an Armature modifier to the Mesh. Make sure to save your progress when you are done (even sooner).
  3. Upper Body Weight Painting:
    Follow the steps in the Upper Body Weight Painting Blender Tutorial, starting with the step called Weight Paint Mode and ending with a step called Testing The Rig. Don't worry about the eyes, we'll not be dealing with them at all in this lab (they have been removed). Make sure to save your progress when you are done (even sooner).
  4. Adding a Lower Body Armature and Weights:
    Follow the steps in the Lower Body Armature Blender Tutorial, starting with the step called Building the Lower Body Armature and ending with a step called Test Poses. You should now be able to pose your entire character. To pose the legs, make sure to use the special leg bone and not the other bones in the legs (the IK takes care of the rest). To pose it along a particular axis (for example to move it only sideways or directly up), click on the leg bone, hit g (for grab) and immediately hit z, y or z. Now the mouse will only move the bone along the selected axsis. Make sure to save your progress when you are done (even sooner).
  5. Adding a Master Bone and Knee Constraints:
    Follow the next steps in the Tutorial, starting with the step called Final Adjustments and ending with a step called Tips for Using the Rig. As before, skip the step about the eyes. Make sure to save your progress when you are done (even sooner).
  6. Animating and Exporting a Wave to Panda 3D:
    1. Follow next steps in the Tutorial, starting with Setting up the Workspace and ending with a step called Finishing the Wave.
    2. To export the wave to Panda 3D, first double-check that your wave plays when you press the play button in the Timeline Window. Then select the Alien model (in Object Mode) and engage the Chicken Exporter script, just like you did in step 1 above. This time you should see new buttons under the heading “Animations:”. Your “Wave” animation started at time 1 and ended at time 9. Enter these numbers into the start: and end: boxes, and put the name “wave” into the name: box. Toggle the pview button on and hit Export. You should see a preview with your Alien waving in it.
    3. Look in your working directory: You should have “alien.egg” and “alien-wave.egg”. Open showalien.py and instead of just loading the model, also load the wave animation and loop it (just need to uncomment the right lines in the code).
  7. Animating a Walkcycle:
    Follow the entire next page in the tutorial on how to Create a Simple Walkcycle. At the end of this step, you should have both a Wave and a Walk action, but you can only have one active at a time (and export one at a time to Panda 3D). The next step solves this with the NLA Editor.
  8. Using the NLA Editor and Exporting Multiple Animations:
    1. Finally, follow the entire Tutorial Page on NLA to understand how you can turn Actions into strips (or clips as they are sometimes called) and place them on a time line.
    2. To export more than one action to Panda 3D, simply place all the action strips, one after the other, on the time line, and engage the Chicken Exporter like before. This time, after you have specified the frame range for the Wave, you can add a second frame range for the Walk by pressing the Add Animation button.
    3. Test this out in your showalien.py by commenting out the right commands and making it loop either the wave or the walk (you can also blend the two together by calling enableBlend on the Actor and setting the blending contribution of each animation with setControlEffect - see commented lines in showalien.py and the Panda Manual on Actor Animations)
/var/www/cadia.ru.is/wiki/data/pages/public/t-vien-12-1/lab_8_materials.txt · Last modified: 2024/04/29 13:33 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki