import direct.directbase.DirectStart
from direct.task import Task
from direct.actor import Actor
import math
#Load the first environment model
environ = loader.loadModel("models/environment")
environ.reparentTo(render)
environ.setScale(0.25,0.25,0.25)
environ.setPos(-8,42,0)
#Task to move the camera
def SpinCameraTask(task):
angledegrees = task.time * 6.0
angleradians = angledegrees * (math.pi / 180.0)
base.camera.setPos(20*math.sin(angleradians),-20.0*math.cos(angleradians),3)
base.camera.setHpr(angledegrees, 0, 0)
return Task.cont
taskMgr.add(SpinCameraTask, "SpinCameraTask")
#Load the panda actor, and loop its animation
pandaActor = Actor.Actor("models/panda-model",{"walk":"models/panda-walk"})
pandaActor.setScale(0.005,0.005,0.005)
pandaActor.reparentTo(render)
pandaActor.loop("walk")
run()
The above code returns no errors, but it does say that panda-walk4 does not exist. So I renamed it to panda-walk (which is the name of the .egg file), but it still doesn’t work. The panda is there, but there is no animation. How would I solve this? It says that the name ‘Interval’ is already defined - is that a problem?
EDIT: This problem only occurs with the panda. Not with the other models I downloaded and tested.