BPPU packing tool

BPPU packing tool v2a

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,300
974
DrSquishy submitted a new resource:

BPPU packing tool - A commandline tool for packing maps, written in python

Written in python3, I've aimed to create a commandline packing tool that can be used on both linux and windows. See the README for information on formatting the various config files, for a list of all arguments that can be passed in, and what to do for some errors encountered.

Python3 is required for this to work, however no external libraries are needed.


Features:
Author lists:
Text files can be created, containing authors for assets. These can exist in the program's directory or...

Read more about this resource...
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,300
974
DrSquishy updated BPPU packing tool with a new update entry:

Miscellaneous fixes + compilepal integration

Started work on this a few months ago but got distracted.
This contains various fixes to packing and parsing, removes the -noauto, -file, -dir parameters, and adds CompilePal integration.

To use with CompilePal: place the BPPU folder in CompilePal/Parameters/ such that the folder structure is /Parameters/BPPU/bppu.py.
This acts to replace the built-in packing for CompilePal, so remove the pack step and add the BPPU step instead. Thank you to Exactol for the help with this.

Repacking has...

Read the rest of this update entry...
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,300
974

chaorace

L1: Registered
Sep 8, 2023
1
1
I hit a few hiccups getting this to work in my environment, but I did manage to get it working! You're a real lifesaver for us Linux peasants!

See below for issue reports on the two bugs encountered thus far:
  1. Crash if tf/particles directory does not exist (it did not exist on my native Linux install of TF2 w/ hammer files copied from a fresh invocation of download_depot 440 232251)
    • Workaround: Manually created an empty tf/particles directory
    • Trace:
      Code:
      ~/projects/tf2/tools/BPPU λ python ./bppu.py /maps/pl_voltage.bsp -parse
      parsing skins..
      done
      parsing skins..
      done
      formatting assets..
      Traceback (most recent call last):
        File "/home/chao/projects/tf2/tools/BPPU/./bppu.py", line 46, in <module>
          interface = BSPInterface(fp, fdlist, location)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/core.py", line 112, in __init__
          self.__Format = FormatAssets(set(list(self.__Parse.get_assets()) + fixed_paths),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/file_handlers/format_assets.py", line 43, in __init__
          for file in (item for item in (self.__TF_PATH / "particles").iterdir() if item.is_file()):
        File "/home/chao/projects/tf2/tools/BPPU/file_handlers/format_assets.py", line 43, in <genexpr>
          for file in (item for item in (self.__TF_PATH / "particles").iterdir() if item.is_file()):
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/pathlib.py", line 931, in iterdir
          for name in os.listdir(self):
                      ^^^^^^^^^^^^^^^^
      FileNotFoundError: [Errno 2] No such file or directory: '../../gamefiles/tf/particles'
  2. Crash if the compiled BSP contains a keyframe_rope w/ a RopeMaterial property that lacks a file extension (the vmt extension is not automatically inserted when using the texture picker, nor is it required for the texture to render in-game)
    • Workaround: Manually added ".vmt" to the RopeMaterial property for every keyframe_rope entity in my level
    • Trace:
      Code:
      ~/projects/tf2/tools/BPPU λ python ./bppu.py /maps/pl_voltage.bsp -parse
      parsing skins..
      done
      parsing skins..
      done
      formatting assets..
      Traceback (most recent call last):
        File "/home/chao/projects/tf2/tools/BPPU/./bppu.py", line 46, in <module>
          interface = BSPInterface(fp, fdlist, location)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/core.py", line 112, in __init__
          self.__Format = FormatAssets(set(list(self.__Parse.get_assets()) + fixed_paths),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/file_handlers/format_assets.py", line 118, in __init__
          raise ValueError("Path %s has no suffix" %path.relative_to(self.__TF_PATH))
      ValueError: Path cable/cable_blue has no suffix
Additional information:
  • Linux kernel info: Linux chao-desktop 6.3.13-2-MANJARO #1 SMP PREEMPT_DYNAMIC Sun Jul 16 16:48:53 UTC 2023 x86_64 GNU/Linux
  • Python runtime version: Python 3.11.3
  • Crashing map file: "pl_voltage.bsp" (see attached)
 

Attachments

  • pl_voltage.bsp
    2.4 MB · Views: 23

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,300
974
I hit a few hiccups getting this to work in my environment, but I did manage to get it working! You're a real lifesaver for us Linux peasants!

See below for issue reports on the two bugs encountered thus far:
  1. Crash if tf/particles directory does not exist (it did not exist on my native Linux install of TF2 w/ hammer files copied from a fresh invocation of download_depot 440 232251)
    • Workaround: Manually created an empty tf/particles directory
    • Trace:
      Code:
      ~/projects/tf2/tools/BPPU λ python ./bppu.py /maps/pl_voltage.bsp -parse
      parsing skins..
      done
      parsing skins..
      done
      formatting assets..
      Traceback (most recent call last):
        File "/home/chao/projects/tf2/tools/BPPU/./bppu.py", line 46, in <module>
          interface = BSPInterface(fp, fdlist, location)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/core.py", line 112, in __init__
          self.__Format = FormatAssets(set(list(self.__Parse.get_assets()) + fixed_paths),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/file_handlers/format_assets.py", line 43, in __init__
          for file in (item for item in (self.__TF_PATH / "particles").iterdir() if item.is_file()):
        File "/home/chao/projects/tf2/tools/BPPU/file_handlers/format_assets.py", line 43, in <genexpr>
          for file in (item for item in (self.__TF_PATH / "particles").iterdir() if item.is_file()):
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/pathlib.py", line 931, in iterdir
          for name in os.listdir(self):
                      ^^^^^^^^^^^^^^^^
      FileNotFoundError: [Errno 2] No such file or directory: '../../gamefiles/tf/particles'
  2. Crash if the compiled BSP contains a keyframe_rope w/ a RopeMaterial property that lacks a file extension (the vmt extension is not automatically inserted when using the texture picker, nor is it required for the texture to render in-game)
    • Workaround: Manually added ".vmt" to the RopeMaterial property for every keyframe_rope entity in my level
    • Trace:
      Code:
      ~/projects/tf2/tools/BPPU λ python ./bppu.py /maps/pl_voltage.bsp -parse
      parsing skins..
      done
      parsing skins..
      done
      formatting assets..
      Traceback (most recent call last):
        File "/home/chao/projects/tf2/tools/BPPU/./bppu.py", line 46, in <module>
          interface = BSPInterface(fp, fdlist, location)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/core.py", line 112, in __init__
          self.__Format = FormatAssets(set(list(self.__Parse.get_assets()) + fixed_paths),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/chao/projects/tf2/tools/BPPU/file_handlers/format_assets.py", line 118, in __init__
          raise ValueError("Path %s has no suffix" %path.relative_to(self.__TF_PATH))
      ValueError: Path cable/cable_blue has no suffix
Additional information:
  • Linux kernel info: Linux chao-desktop 6.3.13-2-MANJARO #1 SMP PREEMPT_DYNAMIC Sun Jul 16 16:48:53 UTC 2023 x86_64 GNU/Linux
  • Python runtime version: Python 3.11.3
  • Crashing map file: "pl_voltage.bsp" (see attached)
Glad to hear it's been helpful for you.
Thanks for the issue reporting, I'm currently getting repacking (.bsp compression) working and I'll get these fixes in with the next update alongside countless other bugs that I've found while using it myself