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.

Replacing:

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

With:

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

Works just fine.

Replacing:

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

With:

self.world = 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,
Gary

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!