O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - playing animations on subparts

To better understand subparts, we should put them into action.

  1. Open Anim_02.py in the Chapter09 folder.
  2. Remove the code that enables blending, sets control effects, and loops the two animations.
  3. Add this code in place of the code we just removed:
    self.kid.makeSubpart("Bottom", ["Root"], ["Waist"])
    self.kid.makeSubpart("Top", ["Waist"])
    self.kid.loop("Thoughtful", partName = "Top")
    self.kid.loop("Walk", partName = "Bottom")
    
  4. Resave the file as Anim_03.py and run it from the command prompt.
Time for action - playing animations on subparts

What just happened?

We've got a much nicer combination of the two animations now because on the legs of the Actor we're ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required