Panda3D Manual: Actors and Characters
<<prev | top | next>> |
Panda3D supports both skeletal animation and morph animations. Panda's egg file format can contain an animatable model, a recorded sequence of animations, or both. The python class `Actor` is designed to hold an animatable model and a set of animations. Since the Actor class inherits from the NodePath class, all NodePath functions are applicable to actors. Note, however, that Actor is a Python class that extends the C++ NodePath class. For the most part, you don't have to think about this: Actor inherits sensibly from NodePath and generally does what you expect. There are a few subtle oddities, though. When you attach an Actor into a scene graph, the low-level C++ Panda constructs only records the NodePath part of the Actor in the scene graph, which is fine as long as you also keep a pointer to the Actor instance in your Python objects. If you let the Actor destruct, however, its visible geometry will remain, but it will cease animating (because it is no longer an Actor). Also, even if you keep the Actor object around, if you retrieve a new pointer to the Actor from the scene graph (for instance, as returned by the collision system), you will get back just an ordinary NodePath, not an Actor. The Actor interface provides a high-level interface on the low-level Panda constructs. In Panda, the low-level node that performs the animation is called Character. You can see the Character node in the scene graph when you call `actor.ls()`. Do not confuse the Actor class with the ActorNode class, which is used for physics. They are completely unrelated classes with similar names. This section assumes you have a valid egg file which has an animatable model, and some additional egg files containing animations. To learn how to convert a model into an egg file see the Model Export section.
<<prev | top | next>> |