Bsp

class valvebsp.Bsp(path=None, profile=None)[source]

Contains all the data from a Bsp file

__init__(path=None, profile=None)[source]

Creates an empty instance of Bsp.

Parameters:
save(destination=None)[source]

Saves the current instance of the Bsp. Overwrites original bsp file if no destination is provided.

Note that the bsp is lazy loaded. When overwritting, only loaded lumps will be written. When saving to a new destination, The original bsp will be copied and loaded lumps will be written on top.

Parameters:

destination (str, optional) – A path (directory + filename) to determine where to save the bsp file.

__getitem__(index)[source]

Provides data at the specified lump index. It is used for both bsp lumps (0, 1, 2, …63) and game lumps (‘prps’, ‘prpd’, ‘tlpd’…)

Parameters:

index (str, int) – The index of the lump.