Hello, here with another little issue. After some trials and problems with loading times, I ended using bams files for the models in my world. The thing is, Panda doesn’t play the animations (in bam models).
I made a little .py for a trial to check outside the main world the problem, the code is as follows:
class ActorTrial(DirectObject):
def __init__(self):
#Set up camera
base.cam.setPos(0,-50,0)
base.cam.lookAt(0,0,0)
#Character
self.actor = Actor.Actor("Modelos/Principal_Modelo.egg",
{"attack" : "Modelos/Principal_Attack.bam",
"standby": "Modelos/Principal_StandBy.bam"})
self.actor.setTexture(loader.loadTexture("Texturas/pprincipal_v3_uv.png"))
self.actor.reparentTo(render)
#Play animations on input
self.accept("space", self.attack)
self.accept("arrow-down", self.standby)
def attack(self):
self.actor.play("attack")
def standby(self):
self.actor.play("standby")
Does somebody know why it isn’t playing the animations? If I use the pview on the bams, I see the animations, but inside panda itself, those doesn’t play.
The bam’s solve my loading problems, but it’s quite frustating that those animations aren’t playing.
There’s nothing about a bam file itself that would change whether the animation plays or not, so there may be something wrong with the way the bam files were built. Can you tell us more about that?
Still, it might be a good idea to convert all three of your egg files to bam, including the model file.
Are there any error messages on the console from the Actor?
… using the “default” model as one animated, it will loop correctly that animation. Only that when another enters (say, we press a button to display the “attack” animation) the first one (the default) will not run again and stayed still.
It doesn’t appear to be related to the use of bam files. The egg files don’t work either.
The problem is that each of your animation files includes a new copy of the model file (they were created with the “-a both” option to maya2egg). This is incorrect. The animation files should have only the animation data (e.g. “-a chan”), and only the model file should have the model data. You should also consider using the -cn parameter to name all of these files with the same character name, to indicate the association between the model and his animations.