lasa01 / Plumber

A Blender addon for importing Source 1 engine maps, models, materials and textures. This addon makes it possible to import full CS:GO, TF2, CS:S or other Source 1 game maps into Blender.
MIT License
395 stars 29 forks source link

Multipart vpk files not handled in wildcard dirs #113

Closed Fennecai closed 2 years ago

Fennecai commented 2 years ago

Describe the bug a VMF I have doesn't import because VPK files mess up....or something, idk. My game configuration is correct but the addon fails to import because file is not VPK (invalid magic)

To Reproduce Steps to reproduce the behavior:

  1. Import a vmf after configuring Portal 2 and it's DLCs
  2. fire dumbledore
  3. there you go, invalid magic.

Expected behavior I expected my map to import like it usually has without issues, rather than Dumbledore getting frustrated and getting himself fired whilst casting the overly-complicated file-import spells required to do so; thus resulting in invalid magic which caused the entire complex to simply vanish. We tried to hire Dr. strange in his place but he was a little busy patching up the multiverse after Cave Johnson messed it up for the 80th time this week...

Related files I cant upload it to Github for fear somebody will discover it and use my work without permission (black mesa can eat my bankrupt-), but that said, it happens on any map import anyways.

Logs

Indexing game files...
Python: Traceback (most recent call last):
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\__init__.py", line 728, in execute
    fs = self.get_filesystem(context)
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\__init__.py", line 475, in get_filesystem
    return game_def.get_indexed_filesystem()
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\__init__.py", line 270, in get_indexed_filesystem
    fs_dict[self.name] = VMFFileSystem(data_dirs, data_paks, index_files=True)
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vmfpy\fs.py", line 82, in __init__
    self.index_all()
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vmfpy\fs.py", line 150, in index_all
    self._do_index(self.iter_all())
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vmfpy\fs.py", line 124, in _do_index
    for path, info in index_iter:
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vmfpy\fs.py", line 121, in iter_all
    yield from self.iter_paks()
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vmfpy\fs.py", line 117, in iter_paks
    yield from self.iter_pak(pak_file)
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vmfpy\fs.py", line 110, in iter_pak
    pak = vpk.open(pak_file, path_enc="latin1")
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vpk\__init__.py", line 16, in open
    return VPK(*args, **kwargs)
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vpk\__init__.py", line 255, in __init__
    self.read_header()
  File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_import_vmf\deps\vpk\__init__.py", line 357, in read_header
    raise ValueError("File is not VPK (invalid magic)")
ValueError: File is not VPK (invalid magic)

Screenshot

image

Details (please complete the following information):

Additional context Please bear with my jokes. Despite the comical tone of this report; the error is real and i cant seem to figure out what the problem is.

lasa01 commented 2 years ago

Usually the error means that you have VPK files in the game configuration that end with _001 or some other number. These files are not really VPK files, they just store content for the "real' VPK files, which have the same name but end in _dir. So the solution would be to just remove any VPK files that end in numbers. For example, pak01_001 should be removed, pak01_dir is the "real" VPK file.

lasa01 commented 2 years ago

Sorry, misclicked, didn't mean to close yet.

Fennecai commented 2 years ago

I am well aware of how vpk files work. Thats not the problem though because i don't have any of the "part" vpks in the game config. i have only specified the actual vpk indexes (the _dir ones)...

though that said; i have specified a couple wildcard paths that happen to contain those "part" files within. that might be the problem...still worth fixing i think. the wildcard shouldn't be searching for files it cant even use

lasa01 commented 2 years ago

Yeah that's most likely the issue, there's no check for that currently.

lasa01 commented 2 years ago

This is fixed in Plumber 1.0.0 beta versions, you can try the latest version here.