References in .egg files

Sorry if this answer exists elsewhere, the search option wasn’t working when I tried it a minute ago.

I’m experimenting with a forest scene with trees that are probably 500 polys a piece and a moderate-sized region where they are planted. What I’m noticing about the .egg format when I export out of Maya 7 is that each one of 50 different trees are copied into the .egg so that my resultant .egg file is quite large (around 6.5 megs). I know about egg2bam, but it seems like there should be a better way to do this, maybe by just referencing a standard ‘tree’ .egg file from the environment .egg or something.

What is the optimal way of pulling off a trick like this with a GUI tool? I suspect I could probably just do some tricks in code to clone models and manually place them, but I’d like my artists to be able to just set everything up in Maya or some other editor and have a nice, efficient way of loading and displaying them.


The first question is: is it really a problem? Sure, 6.5 MB is pretty big, and it will probably be slow to load, but the bam file will be much smaller and won’t be particularly slow to load.

But the answer to your question is, we don’t (currently) have support for model instancing through the whole maya2egg, egg2bam pipeline. We’ve just never needed this support before, because usually Maya is used for the individual model creation, but not the overall scene arrangement; and even if it is, replication of models is not so bad, and gives the artist the greatest possible control over the look anyway (the artist can tweak vertices on individual trees, for instance, to make the final scene look “just so”).


50 different trees ? Are they the same tree model (the same shape, only rotated by different angles maybe) instanced 49 times, or completely different tree models (different species, different shape of course) ?
If they’re all just the same, you can trick it this way :

  1. in Maya, create a simple “tree holder” object, give it a specific name, place it exactly in the middle of your original tree trunk base, and parent your tree to it (using outliner). put the tree on different layer for easy visibility toggling.
  2. instance the “tree holder” and place them on your scene as needed
  3. you don’t need to export your trees, just export the “tree holder” objects instead. So, hide all the particular trees by set the trees’ layer to invisible/template/reference. select all objects (or needed) object in your scene, and export them (selected only).
  4. in Panda, find ALL “tree holder” objects by name and parent your tree model (loaded from different tree model file, as you want) instances to them.
  5. FINISHED ! you’ve got your trees planted on their specified spots.

Thanks for the responses.

I can see where you’re coming from David, although I guess I’m of the opinion that just because we can afford the disk space or RAM, it doesn’t make sense to use it unless we need to. In this example I gave, I simply had my artist create a test environment that was 40x40 on a side with 50 popsicle trees in it. If even a simple example with 50 translated models is inefficiently stored, how can I hope to optimize more complicated ones?

I’ve done my share of software development over the years, so I certainly understand what it is like to have someone try to use your software in an unexpected way. The thing I’m struggling with right now is how to give my artists a visual way of designing complex scenes. The SceneEditor, although it now starts up in the trunk revision, doesn’t appear usable at the moment. The only other tool I know of is Maya itself. We’re rapidly getting to a point in our development projects where hand-coding the scene gemetry in script doesn’t make sense. I feel like there is an intermdiate file format missing here that can exist between the individual models (.eggs) and the script. Something like a map in other game engines.

In any case, thanks again for the feedback. I’ll just have give some more thought on what will work for us here.