Do bams presurve Model <flag> ?

Egg’s tag has a Model flag that sets node as important. It does not look like bam or pg has this flag.

In my egg editor i load the egg then to save I use writeBam and then use bam2egg to create the final egg file. That some times erases Names of nodes and converts NodePath’s to nameless GeomNodes. Is there a way around this? Maybe a direct way from Pg to egg?

I have egg-flatten set to 0 in my prc but maybe bam2egg utility does not.

The bam format does indeed have a flag; which is to say, bam stores ModelNodes, which is what the flag gets turned into. In general, bam supports everything that egg supports, and more (though not quite everything you can store in a scene graph).

However, bam2egg doesn’t support nearly everything that both bam or egg support.

The conversion from bam to egg is necessarily lossy. Even beyond the features missing from bam2egg, it’s probably impossible to make a bam2egg that reproduces the original egg file. The structure of the egg file is just too different from the structure of the bam file (and the structure that Panda uses internally).

This is by design. An egg file is designed as a high-level abstraction of a scene, and its syntax is designed to make it easy to describe things in a portable way. A bam file, however, is designed to mirror Panda’s internal structure, which is itself designed for rapid rendering and easy runtime manipulation. So, there’s a pretty serious translation process that has to go on when you go from egg2bam (or when you just load an egg file), and that translation is hard to do in reverse.

So, short answer is, I don’t recommend this approach. Instead of loading your egg file as a model, read it as an egg file and operate on the egg structures. Then you can write it back out without damage.