Multifiles are mounted with VFS, yet dont load textures.

Hi all! I’ve been trying to find a way to mount multifiles so that I can use my game after it has been frozen with pfreeze. It keeps giving me an error about how it cannot load a texture, although the multifile has been mounted.
Here’s the code I’m using to mount:

from panda3d.core import *
vfs = VirtualFileSystem.getGlobalPtr()
import glob
for file in glob.glob('../resources/*.mf'):
    mf = Multifile()
    names = mf.getSubfileNames()
    vfs.mount(mf, Filename('/'), 0)
    print('mounted ' + file[13:])

And here’s a traceback:

:ClientStart: Reading user/preferences.json...
:ClientStart: Starting the game...
:loader(error): Couldn't load file phase_3/models/gui/loading-background.bam: not found on model path (currently: "../resources/;/c/ToontownRebuilt/src/toontown/toonbase;/c/ToontownRebuilt/src/dependencies/panda/etc/..;/c/ToontownRebuilt/src/dependencies/panda/etc/../models")
:ClientStart: Setting the default font...
TTLocalizer: Running in language: English
OTPLocalizer: Running in language: English
Known pipe types:
(1 aux display modules not yet loaded.)
:ToonBase: Default graphics pipe is wglGraphicsPipe (OpenGL).
:display:windisplay(warning): Could not find cursor filename phase_3/etc/toonmono.cur
:display:windisplay(warning): Could not find icon filename phase_3/etc/icon.ico
:display:windisplay(warning): Could not find cursor filename phase_3/etc/toonmono.cur
:ToonBase: Successfully opened window of type wglGraphicsWindow (OpenGL)
:ShowBase: __dev__ == False
:loader(error): Couldn't load file phase_3/models/gui/progress-background.bam: not found on model path (currently: "../resources/;/c/ToontownRebuilt/src/toontown/toonbase;/c/ToontownRebuilt/src/dependencies/panda/etc/..;/c/ToontownRebuilt/src/dependencies/panda/etc/../models")
Traceback (most recent call last):
  File "C:\ToontownRebuilt\src\dependencies\panda\python\lib\", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\ToontownRebuilt\src\dependencies\panda\python\lib\", line 72, in _run_code
    exec code in run_globals
  File "C:\ToontownRebuilt\src\toontown\toonbase\", line 120, in <module>
  File "toontown\toonbase\", line 160, in __init__
    self.loader = ToontownLoader.ToontownLoader(self)
  File "toontown\toonbase\", line 14, in __init__
    self.loadingScreen = ToontownLoadingScreen.ToontownLoadingScreen()
  File "toontown\toontowngui\", line 15, in __init__
    self.gui = loader.loadModel('phase_3/models/gui/progress-background.bam')
  File "C:\ToontownRebuilt\src\dependencies\panda\python\direct\showbase\", line 170, in loadModel
    raise IOError, message
IOError: Could not load model file(s): ['phase_3/models/gui/progress-background.bam']
:TaskManager: TaskManager.destroy()

Any and all help is appreciated. Thank you :slight_smile:

You’re mounting to / but / is not on the model-path. Try adding “/” to the model-path and see what happens.

Thank you. I realised that for this to work with multifiles, i would have to change every occurance of “phase_” with “/phase_”. And because I am too lazy to do that right now, I have added the entire resources folder including uncompressed textures within folders (phase_(number)) and that works for me. It has turned out a success, and my game is now fully compiled and working!

Or you could just add “/” to the model-path, which would not require you to alter every occurrence of the path manually.


model-path /

Or in code:

from panda3d.core import get_model_path()

It’s a bit strange to use / for this, it’s more typical to mount it to a path like /mf and then add /mf to the model-path.