I tested with the Panda3D 2008.03.04, the problem remains.
I wrote the code specially to test the animation; it contains no collisions or anything to affect the results. Here is it:
from direct.actor.Actor import Actor
from direct.showbase.DirectObject import DirectObject
from direct.task.Task import Task
from pandac.PandaModules import loadPrcFileData
#loadPrcFileData("", "even-animation 1")
#loadPrcFileData("", "interpolate-frames 1")
import direct.directbase.DirectStart
modelsDir = "Roaming-Ralph/models/"
class World(DirectObject):
def __init__(self):
self.actor = Actor(modelsDir+"ralph",
{"run" : modelsDir+"ralph-run"})
self.actor.reparentTo(render)
self.actor.setScale(.3)
self.keyMap = {"animate" : 0}
self.accept("a", self.setKey, ["animate", 1])
self.accept("z", self.setKey, ["animate", 0])
self.animationLoops = 0
taskMgr.add(self.updateWorld, "updateWorldTask")
def setKey(self, key, value):
self.keyMap[key] = value
def updateWorld(self, task):
if self.keyMap["animate"] and not self.animationLoops:
self.actor.loop("run")
self.animationLoops = 1
if not self.keyMap["animate"]:
self.actor.stop()
self.animationLoops = 0
base.camera.setPos(10, 10, 10)
base.camera.lookAt(self.actor)
return Task.cont
w = World()
run()
As you can see, when Ralph is idle, he is not animated (all animations are stopped).
When I launch this code in 1.4.2, my fps are above 200: when Ralph is animated, the fps are a bit lower then when he is not animated, but still, fps are above 200+. Something like 210 fps without animation, and 200 fps with animation.
In 1.5.0 RC, when Ralph is not animated, I get the same 200-210 fps, as in 1.4.2. But as soon as I start animation, fps fall below 150. This issue appears all the time, not just occasionally.
Josh, I tried to run this code for some long time but I didn’t notice the bimodal behavior you described (neither in 1.4.2 nor 1.5.0). I don’t know, maybe I ran it not long enough
David, neither “even-animation 1” nor “interpolate-frames 1” help. In 1.5.0 with an animated model I get much slower frame rate then in 1.4.2.