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()
    mf.openReadWrite(Filename(file))
    names = mf.getSubfileNames()
    vfs.mount(mf, Filename('/'), 0)
    print('mounted ' + file[13:])

And here’s a traceback:

mounted phase_10.mf
mounted phase_11.mf
mounted phase_12.mf
mounted phase_13.mf
mounted phase_3.5.mf
mounted phase_3.mf
mounted phase_4.mf
mounted phase_5.5.mf
mounted phase_5.mf
mounted phase_6.mf
mounted phase_7.mf
mounted phase_8.mf
mounted phase_9.mf
: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:
  wglGraphicsPipe
(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\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\ToontownRebuilt\src\dependencies\panda\python\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\ToontownRebuilt\src\toontown\toonbase\ClientStart.py", line 120, in <module>
    ToonBase.ToonBase()
  File "toontown\toonbase\ToonBase.py", line 160, in __init__
    self.loader = ToontownLoader.ToontownLoader(self)
  File "toontown\toonbase\ToontownLoader.py", line 14, in __init__
    self.loadingScreen = ToontownLoadingScreen.ToontownLoadingScreen()
  File "toontown\toontowngui\ToontownLoadingScreen.py", line 15, in __init__
    self.gui = loader.loadModel('phase_3/models/gui/progress-background.bam')
  File "C:\ToontownRebuilt\src\dependencies\panda\python\direct\showbase\Loader.py", 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.

Config.prc:

model-path /

Or in code:

from panda3d.core import get_model_path()
get_model_path().append_directory("/")

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.