File Extensions

As I understand it, file extensions are not needed when loading models. Makes sense as the last thing one might want to do with a game is replace egg files with (at least) bam files and (more likely) pz files.

So I’m curious.


self.explosionModel = self.loader.loadModel('models/explosion.egg')


self.explosionModel = self.loader.loadModel('models/explosion')

Works just fine.

Replacing: = self.loader.loadModel("models/world.bam")

With: = self.loader.loadModel("models/world")

…does not. It results in a model cannot be loaded error.

Am I doing something wrong? Or can I only drop file extensions for certain types of model?

Best Regards,

This is set in etc/Confauto.prc:

default-model-extension .egg

It is recommended to use this method to load .egg files in your game. Whenever you pack your game using packp3d, it will automatically convert your assets to .bam and will internally change the default-model-extension to .bam, so that no changes to the code are needed when using packp3d (and pdeploy).

Understood. Thanks!