Parsing egg files.

Hello everybody,

I am currently trying to make a tool in Panda and I need to understand how to parse egg files, I’ve seen in the reference that there are classes such as EggData, EggPolygon, etc…

I think what I need is quite simple:
-vertices
-polygons
-texture coords
-bones data
-how is each vertex related to each bone
-the bone “matrices” at each frame for each animation

or, simply, the egg file’s content.

But, I’m not much of a genius and I didn’t really understood how the data is stored inside the Egg* classes.

So I wondered if I missed any doc lying around or any other post on this forum that could be of any help… or if there is code already done for that sort of things.

Thanks for any help!

There is various code on the forums that use the Egg* classes, search the forums for “obj2egg” or “octree”.

You could also try searching for EggData.

But I have to wonder what kind of an application you’re writing that requires so much detailed information about your model? If you’re hoping to correlate this information with the model itself as it’s being rendered, you may be in for a disappointment; Panda freely massages the egg data as it loads it into a renderable model, so that egg vertices no longer correspond one-to-one with the rows in a GeomVertexData.

David

Actually I am trying to export the egg files back and forth into a specific format, which has no Egg import/exporter since it’s not much used.

I’ll check out what you are pointing me to, thank for the replies.

Using the eggData is very easy
far far sear then writing your own parser.
See my version of egg octree discourse.panda3d.org/viewtopic.php?p=23267#23267 on how to read/write egg file
and my obj2egg converter on how to do model building discourse.panda3d.org/viewtopic.php?t=3378