Wrong file path for textures on .bam models

I extracted some files from a .mf file using Multify.exe. The extraction went ok, but when I try to open the models none of the textures show up. I get error messages like this:

:gobj(error): Texture::read()- couldn't read: folder/texture folder/texturefile.jpg
:gobj:(error) Unable to find texture"folder/texture folder/texturefile.jpg" on model-path /c/Panda3D-1.81/bin;/c/Panda3d-1.81/etc/..;/c/Panda3D-1.81/etc/../models

From my understanding, it’s looking in the wrong place for the texture files. How can I tell it to stop looking in the Panda 3d folders? When I put the appropriate file path into the bin folder in Panda3d then it can read the textures, but I need it to not be looking in the Panda files. Any help you can give me would be great, thanks!

Manualy setting a new texture doesnt do the trick?

texture = loader.loadTexture("\\Textures\\texturefile.jpg")

That should load texturefile.jpg that is located in the Texture folder next to your main python file.

Can imagine you’ll just want it to work automatically though… but untill someone can tell you more about multifile conversion you may want to use this.

Panda searches along the model-path for any textures that are to be loaded. When it generates bam files, it also searches along the model-path for the textures, and shortens the filenames to the relative path from model-path. So it’s probably a good idea to have the same model-path when you generate a bam file as you have when you load a bam file.

There are other ways to customize this behavior, but you didn’t tell me enough about what you’re doing. What model are you loading from an mf file, how did it get placed into the mf file in the first place, and how is your extraction environment different from the environment that you (or someone else) was running when you built it?


Thanks for the replies.
Honestly, I don’t know how to use Panda very well yet(I don’t know Python or C++), so I’m trying to convert the .bam models out of panda form and into a format that will work for the tool I’m using(Unity). I don’t have any coding for a Panda project, just models that I opened with pview. If you could walk me through the manual resetting the textures thing that would be great.
The folders and such are still in the original format that they were in when I extracted them. Like I said in my original post, if I make an identical relative filepath in the bin folder then it works, but it thinks that the relative path starts in the bin folder of the Panda3d files, not the folder that the models are in.

If your goal is to convert the models to another engine, you’re probably best using bam2egg to convert them first to egg form, then use egg2maya or egg2obj or write your own egg2whatever. In this case, the texture path searched by the Panda loader becomes largely irrelevant.


I don’t have egg2obj in my install, is it supposed to be there? I tried using bam2egg, egg2x, and then autodesk FBX converter, but I still have no textures. I don’t think you can apply textures in unity. I was messing with the options in the converters, but it still reads it wrong. Would you mind helping me figure out how to properly convert these? I tried using the path redirect objects and such, but it still didn’t work for me. Thanks!

Now that I think about it, egg2obj probably exists only in the dev build (and maybe it doesn’t exist there either). But you can search the forums, I think someone else wrote a similar program in Python. But egg2x should do the thing too.

You might still need to put the texture directory on your model-path, by editing the Config.prc file as I described in your other post. Or, you can simply hand-edit the egg file (or the x file) to fix the paths to where they should be–both of these are easily editable ASCII file formats.