I’ve got an .egg I converted from Maya 6 that has all the animations included within the same egg file.
When I load the egg, the textures and everything looks good, however, the only animation that works is the “root” animation where my character bobs up-and-down.
Any suggestions? I’m really just playing around with Panda3d right now trying to figure out how to do things. I was using the sample script at the begining of the docs where the panda is loaded in the environment and the camera rotates around the panda while the model walks in place. I wanted to just get my model to run-in-place or something.
The Actor interface was never designed for multiple animations stored within one egg file. Although I think the version on the CVS trunk might have support for this, and possibly Panda3D 1.1 also includes this support, I’m not 100% certain of this.
In any case, it’s easiest to put each animation in a separate egg file. This just gives you more control over each individual animation. If you truly have a need to have them all combined, we can work out the details of how to make that work.
No, I don’t really need everything included in one file. I just noticed the exporter could do this by the -a both option to maya2egg6. I also noticed that you can export the animations only out to seperate files and the skinned mesh to another egg. I will try it this way.
I was able to separate the animations into separate files from my Maya binary file. It works great! Now that I realized I can’t have LOD’s in an egg my model looks good now as well.
Great! Incidentally, it is possible to put LOD’s in an egg file, but they don’t work in animated (character) egg files. I’m also not 100% sure that the maya2egg version in Panda3D 1.1 has the full support for LOD’s even in the static egg files.
Hmm, I guess this was my problem then or maybe a combination of my problem and the exporter isn’t setup with the full LOD support.
I’ll try it again today. Remove the animations from the .mb and put it in its own egg and leave the LOD’s in the first egg with the mesh. We’ll see if that works. I thought I tried this yesterday but it didn’t seem to work. There are a lot more switches with the maya2egg exporter that aren’t in the docs and the only reason I found out about them is because I’m a UNIX guy and tried -h on the maya2egg6 binary
It’s not a matter of removing the animations; it’s a matter of converting the model with the ‘-a none’ option, which converts a static model. Although a static model an an animatable model are both stored in egg files and both look similar in-game, the static model goes through a completely different load path than the animatable model, and it supports more esoteric options like LOD’s.
Of course if you convert your model as a static model, you then won’t be able to animate it. If you want to have LOD’s on an animated model, you presently have to have a separate model file for each LOD (or use the -subset parameter to convert each one to a separate egg file), and then use the Actor LOD interface to load up each model as a separate LOD within the Actor.
The Actor LOD interface is a bit messy, but in a nutshell you can pass a dictionary of model filenames to the constructor, like:
And it will create an LODNode for you. Then you can call a.getLODNode().setSwitch(0, 100, 50), or whatever, to set the switching distances. See LODNode for more information.
One day we hope to unify the static and animatable model pipelines, so more of this can be implicit.
What I was doing was using -a model and then -a chan for the animations (but all in one file). Then I looked a little closer and learned of -sf -ef for animations and used them to break out each animation into their own eggs.
I still had the z-fighting problem though even after using the -a model so just removed them.
If I understand correctly then I can export the model skinned and boned for each LOD into their own files and the animation separately.