How to load file out of the Model Path?

I would like to know how to load model files that are NOT on the model path (from any config prc).
For a sceneEditor you must be able to pick model from any place of your hardrive.
Also i know the path is good as it come from a tkaskopenfilename control.

Error is :

By the way if i put the bam file in ./models it works, this mean in
e/WG/Panda3D1/SceneEditor/models which don’t look like on the path described in error message!

Thanks before hand this is driving me crazy.

panda (or maybe python) searches from the “main” file you run from. So if you sitck a model “level1.egg” into the directory ./environ from your .py file, you can just load by:

level = loader.loadModel(“environ/level1”)

Make sure you make paths relative to the main file, even if you are loading from files that have been imported into the main file. You would still load from the directory your main file is in.

Also note that if you wanted to explicitly load the file E:/WG/Panda3D1/models/test.bam, regardless of your model-path, you should name the file following the Panda Filename convention: /e/WG/Panda3D1/models/test.bam .

To Panda, the initial E: looks like a local directory named “E:”, it doesn’t realize that’s intended to be a drive letter. But if you start your filename path with /e/, it understands that you mean a file on drive E.