Animation problem

I think this is the right session.
Hi, I am having some pretty strange trouble with my animations. I load five characters (the model and the textures are loading fine), but when I try to animate them, only two are being animated.
I can see all the animations on pview, but in-game, some simply would not work (no errors/warnings are shown).

Here is one example of how I load a character:


sampleMage = beingClass.being(worldManager, gridElement, "models/Mage/mago", {"walk":"models/Mage/anim_caminha", "attack":"models/Mage/anim_ataque"}, 0.02, 15, -45, 0, '../chars/ralph.txt', 2, spellMngr)

The third argument is the main model and the forth argument loads the animation name and the egg that contains it.

Here is the code that animate them (the position doesn’t change):

    def attackAnimation(self, theWorld):
        formerState = theWorld.getState()
        theWorld.setState("stopAndAnimate")
        interval = self.classModel.posInterval(3, 
           Point3(self.getPosX(), self.getPosY(), self.getPosZ()),
           startPos=Point3(self.getPosX(), self.getPosY(),self.getPosZ()))
        animation = Sequence(interval, Func(self.endAttackAnimation, theWorld, formerState))
        self.classModel.loop("attack")
        animation.start()

    def endAttackAnimation(self, theWorld, formerState):
        theWorld.setState(formerState)
        self.classModel.stop()

Any ideas are welcome.

Thanks in advance.

I don’t see anything obviously wrong in the code, though you might be better off with an ActorInterval to control the animation, instead of this strange loop() and stop() call outside of the interval.

Do the animations play if you simply load the actor at a python prompt and call loop() there?

David

Just tried the “panda hello world” replacing the panda actor with my healer animation, he just stands there, doing nothing, again the animation is shown on pview.

Thanks for the time, still. I am gonna look into it more tomorrow, need to wake up early to work.

Any other suggestions are welcome.

Seems odd that the animation would play in pview but not using the Actor interface–it uses the same code beneath. Can you post the two egg files (the model egg file and the animation that doesn’t play)?

David

4shared.com/file/174606333/7 … ealer.html

There is the animation, there is a “panda hello world” with the walk animation “loaded.”
Thanks for the help.

Didn’t test the models but I took a look what’s inside.

It looks like all of them (except curandeiro.egg -it only has the model-actor) have both the model (a {1} section ) and animations ( character) in one file. Try to export just the animations.

To be honest I don’t know how to play a animation that’s in the same file as the model from python… if for some reason you really want to keep animations and models in one file then David or The User Formally Known As Pro-rsoft will know how (but I don’t think that’s what you’re aiming for).

Just tried it, did not work too… any other suggestions?

EDIT: Problem solved, the bones were missing.
Thanks a lot for the help and thanks for the animation tip, it reduced the size of the files by a lot (almost 90%).