Querying whether EggData is a model, actor or animation

Hey all,

I’m looking for a bullet-proof way of finding out whether an egg file contains model, actor or animation data. Is there a more elegant way of doing this instead of stepping through the entire hierarchy looking for bones, tables, etc?

If the egg file contains a tag, it is an actor. If it contains a , it is an animation. If it contains polygons outside of a , it is a static model.

There is not a more elegant way to answer this question, because the question itself is a little ambiguous: it is possible for a single egg file to contain all three things, in which case the only correct answer is “all of the above”.


Hi David, thanks for the quick reply. I’m trying to build a model viewer where the user can select any egg file and have it rendered on the screen, or just be able to see the contents of it in the case of an animation. In the case of an egg file containing an actor plus some animations, it seems like I would have to recursively search through the eggdata hierarchy trying to match the criteria you’ve written above in order to know what arguements to call when using ‘actor’. Does that sound right?

Right. It shouldn’t take more than a few milliseconds to recursively search the entire eggdata structure.


Thanks heaps, David. I’ll try that out!