Animations in pview and egg-optchar

I have some egg models and animations that have been exported from maya, and I have been having some problems with them. In Panda, everything works fine. The model shows up, and the animation works like I want it to. The problem is, whenever I use pview, the model shows up, but the animation doesn’t play. This happens only when I have a separate actor and animation that I need to load. If the model was saved with the -both tag, the animation registers and everything plays correctly. So I can’t pview animations which is an annoyance, but I worked around it by making a file that uses panda’s normal graphics pipe.

The real problem is when I want to use egg-optchar. Since the animations don’t register on the model, egg-optchar deletes all joints in the skeleton of the model file and practically erases the animation file. After that, needless to say, the animations don’t work at all. This doesn’t happen on all models, and in the earlier versions of panda (around 1.0.3 or earlier, I dont exactly remember), it didn’t happen at all. I am wondering what the problem could be. Is there some way in which the maya models should be grouped before they are exported? Could it be a problem with the maya2egg exporters?


I’m betting that your models and animations don’t have the same character name. Panda uses this name as a cue to tell it which animations are intended to be associated with which skeletons. pview and egg-optchar respect this name by default, but the code ignores it by default.

Use “-cn” on your maya2egg command line to give all of the animations on a given skeleton, and the skeleton model itself, the same name. Ideally, you would assign a different name to different skeletons, but if you’re lazy you can just set everything in the universe to the same name. :slight_smile:


That sounds about right, since some animations are saved out in different maya files than some of the models (which would also change the model/skeleton name even though its the same model). Is it reccomended to layer maya animations in the same file?

For the skeleton name, I am assuming that in the name of the first tag in the model file needs to match the name of the first tag in the animation file. And if I had different models of which had the same skeleton hierarchy and would use the same animation file, I would need to use the “-cn” parameter to export those skeletons and make all of the skeletons the same name.

But would optimization work on a new character model given the animation has already been optimized (changed)? Or would I have to keep exporting animations to optimize each model?

Also, what is the significance of the line { 1 } right after the first tag? I ask this because when trying to create a tag for a polygon set, it won’t work unless { 1 } is removed.

Thanks again.

This is the way we work in the VR Studio, with a different file for each animation and/or model. We just always use the -cn parameter to specify the appropriate name when converting (our conversion scripts do this automatically).

Exactly right.

If I understand your meaning here, you are correct–you must always run egg-optchar on a freshly-converted set of animations and/or models. The easiest way to do this is to convert all of your animations and models into one directory and leave them there, unchanged, while you use the -d parameter to write the output of egg-optchar into a different directory. Then, when you convert a new animation, just run egg-optchar from the source directory again.

The syntax is used to indicate the beginning of a character (jointed) model, which is read with a completely different loader than a static model. Unfortunately, this character loader does not currently support the tag or many other egg tags, so you will have to load your polygon set independently and attach it to your animated character in Python code (for instance, by exposing joints, as illustrated in the Eve demo).


Thank you David, and yes you understood me completely. The collide tag was meant to be put on a static model, which was mistakenly exported as a character through the MEL script that was provided. I just thought I would ask about it while it had my attention.