My new animation crashes Panda

I’m building a Silly Little Racing Game ™. As part of that, I’ve made a Silly Little Car Model with spinning wheels. I use the arrow keys to drive it around and everything’s great. I also have some humans who can walk around and wave and what-have-you.

Now, though, I’m trying to make a door-opening animation for my Silly Little car Model. The animation exports fine, but when I try to play it (or set its play rate), I get this:

:egg2pg(warning): Ignoring inappropriate format rgba for 3-component texture Tex1
Assertion failed: !is_empty() at line 270 of c:\temp\mkpr\panda3d-1.2.3\panda\src\pgraph\nodePath.I
Traceback (most recent call last):
  File "C:\Projects\SLCG\source\Game.py", line 486, in ?
    run()
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\showbase\ShowBase.py", line 1959, in run
    self.taskMgr.run()
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\task\Task.py", line 821, in run
    self.step()
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\task\Task.py", line 769, in step
    self.__stepThroughList(taskPriList)
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\task\Task.py", line 703, in __stepThroughList
    ret = self.__executeTask(task)
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\task\Task.py", line 633, in __executeTask
    ret = task(task)
  File "C:\Projects\SLCG\source\Game.py", line 33, in Pulse
    UpdateObjects(dt)
  File "C:\Projects\SLCG\source\Objects.py", line 107, in Animate
    self.actor.setPlayRate(1, 'open_trunk')
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\actor\Actor.py",line 600, in setPlayRate
    for control in self.getAnimControls(animName, partName):
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\actor\Actor.py",line 1283, in getAnimControls
    animControl = self.__bindAnimToPart(animName, thisPart, lodName)
  File "C:\Projects\SLCG\Panda3D-1.2.3\direct\src\actor\Actor.py",line 1570, in __bindAnimToPart
    animBundle = (animNode.find("**/+AnimBundleNode").node()).getBundle()
AssertionError: !is_empty() at line 270 of c:\temp\mkpr\panda3d-1.2.3\panda\src\pgraph\nodePath.I

I can get rid of the egg2pg warning by editing the .egg file, but that doesn’t prevent the crash.

I’m certain that the animation file is in the right directory and that I’m correctly loading the animations into the actor. Does anyone have any idea what I might be doing wrong?

This is the sort of error message you get if the egg file you are loading for the animation does not actually contain an animation. Check the egg file in question: it should contain tables of numbers, grouped within a hierarchy of

entries.

David

Sorry for not helping.
I was just wondering, do you actually using real physics calculation for your racing game, or simply fake physics like my experiment ?
If it’s real one, I’d like to know for more, if you don’t mind.

That’s exactly right. That’s what an egg file that contains an animation looks like. But still, the error message indicates that you have attempted to load an egg file that does not contain an animation. So the next question is: is it possible that you named put the wrong egg file on the Actor.loadAnims() call, or to the anims parameter of the Actor constructor?

To fully prove that your egg file contains an animation, you can do something like this:

anim = loader.loadModel('my-animation.egg')
anim.ls()

and you should see something like this:

ModelRoot my-animation.egg
  AnimBundleNode my_character_name

If you don’t see an AnimBundleNode, something is wrong with your egg file. If you do see an AnimBundleNode, this egg file is fine, so it must be some other egg file that’s causing this error.

Incidentally, you can use Python’s pdb to help you debug this further. In the Actor.py code in __bindAnimToPart(), you can see in the lines before line 1570, that the filename of the egg file it is loading is stored in the variable animPath. Therefore, when you get the crash, you can type the following at the Python prompt:

import pdb
pdb.pm()
print animPath

to see exactly which egg file is causing this crash.

David

About the fake physics :
so far I’ve managed to make my car moves smoothly on some kind of road, e.g. wavy road, twisted road, and jump down quite well.
= I put 1 collision sphere and ray on each wheel
= I calculate the gravity load on eachwheel, so that it gives more natural movement when it jump off the road.