one model with several animations doesn't work

hi there,

i have created a model in maya with several animtions which all of them i saved as a different maya file.
i exported the model as an “Actor” and then every animation as “Animation”.
I loaded my model into Panda and depending on the button I press a different animaion should play.
Unfortunatelly it does’t work, the animtion doesn’t play. I don’t know if my code is wrong or my exported files.

Here is my code:

# -*- coding: utf-8 -*-
import direct.directbase.DirectStart
from pandac.PandaModules import CollisionTraverser,CollisionNode
from pandac.PandaModules import CollisionHandlerQueue,CollisionRay
from pandac.PandaModules import Filename
from pandac.PandaModules import PandaNode,NodePath,Camera,TextNode
from pandac.PandaModules import Vec3,Vec4,BitMask32
from direct.gui.OnscreenText import OnscreenText
from direct.actor.Actor import Actor
from direct.task.Task import Task
from direct.showbase.DirectObject import DirectObject
import random, sys, os, math


class World(DirectObject):

    def __init__(self):

        base.setBackgroundColor(.8,.8,.8)

        #light1 = render.attachNewNode (PointLight("light1"))
        #self.render.setLight(light1)
        #self.light1.setPos(0,-50,20)

        base.cam.setPos(0,-50,10)

        self.machine = Actor ("models/count_model", {
          "0":"models/count_00_anim",
          "1":"models/count_01_anim",
          "2":"models/count_02_anim",
          "3":"models/count_03_anim",
          "4":"models/count_04_anim",
          "5":"models/count_05_anim",
          "6":"models/count_06_anim",
          "7":"models/count_07_anim",
          "8":"models/count_08_anim",
          "9":"models/count_09_anim"})
          
        self.machine.reparentTo(render)
        self.machine.setScale(.5)

                
        #self.accept("escape", sys.exit)#exit on esc
        self.accept("0", self.machine.play, ["0"])
        self.accept("1", self.machine.play, ["1"])
        self.accept("2", self.machine.play, ["2"])
        self.accept("3", self.machine.play, ["3"])
        self.accept("4", self.machine.play, ["4"])
        self.accept("5", self.machine.play, ["5"])
        self.accept("6", self.machine.play, ["6"])
        self.accept("7", self.machine.play, ["7"])
        self.accept("a", self.machine.play, ["8"])
        self.accept("9", self.machine.play, ["9"])
        


w=World()
run()

I bet this line:

self.accept("a", self.machine.play, ["8"]) 

is supposed to read:

self.accept("8", self.machine.play, ["8"]) 

David

yes you are right. i was just trying out sth.
But unfortunately this is not the source of the problem.

Well, the first thing to try is to verify that you can view the animation in pview:

pview models/count_model.egg models/count_00_anim.egg

Try that for a working animation, and also for the broken anim. If it works for the working anim but not for the broken anim, then it must be the egg file, and not your code.

Also, look for error messages on the console when you run pview. Common error messages are things about joint hierarchy not matching up between model and animation.

If it is your egg file, examine the anim egg file and look for tables of numbers. Compare it to a working anim egg file for reference. If you don’t see big tables of numbers, then something about your animation didn’t export correctly.

David

I figured it out.

the animations were fine but my “Actor” export was wrong. I exported my model as “Actor” without any keyframes in maya.

Now that I exported as “Actor” it with the actual animation it is working.

thanks for your help :smiley: