Swapping TXOs?

Is there anyway to produce TXO.PZ files besides using egg2bam? I’m asking this because I plan to change the textures of a character in-game, and I can’t seem to find a way to produce textures in this format unless there’s a texture reference to them in the EGG file while I’m converting it to BAM.

I’m also assuming here that loadTexture will work fine with a TXO.PZ file… haven’t tried this yet, actually. I’ve only relied on specifying the tex ref in the EGG file and bamming the file with the -txo flag so far.

I never really looked into txo, but theres a writeTxo for textures:
panda3d.org/apiref.php?page=Texture#writeTxo
I guess you could do a loader.loadTexture(“yourtex.png”).writeTxo, and then use pzip to convert it to .pz…

PS. I think (but I’m not entirely sure) the tool egg-texture-cards can convert a texture to a .egg.

You could use write in-game to directly write .txo.pz files:

myTex.write(Filename('myTex.txo.pz'))

Note that writeTxo() is a lower-level function that receives an ostream, not a Filename. But the higher-level write() function will automatically write a txo file when it sees a filename with the .txo extension.

Oh, and egg-texture-cards + egg2bam is also a fine way to do this via a command-line script.

David

Excellent… thanks, it works fine.