Hello, I just have a little problem starting with Panda3d.
The following code isn’t working (aka the animation isn’t animating):
import direct.directbase.DirectStart
from direct.actor.Actor import Actor
class actorLoader():
def __init__(self):
character = Actor()
character.loadModel("test")
character.reparentTo(render)
character.loadAnims({"win":"test"})
character.loop("win")
s = actorLoader()
run()
I guess I just didn’t get the way the loop is telling panda
to repeat it. I’m sorry if this question is too basic…
It seems like you load the same model for the animation, “test”. Are you sure the test.egg really contains both the animation and the model? You probably would have the animation in a different file, like test_myAnim.egg and specify loadAnims({“win”:“test_myAnim”}) instead.
I think it garbage collected the python class that had the animations stored. Animations are not stored in c++ and panda3d nodepath so it just vanished as soon as it went out of scope the class was garbage collected even before the game was started.