snake-biscuits / bsp2gltf

2 stars 1 forks source link

Add ValveBsp support #9

Open snake-biscuits opened 11 months ago

snake-biscuits commented 11 months ago

Can port code from bsp_tool

TODO: rework valve.source.vertices_of_face to account for t-junctions

Recently visualised t-junctions & now understand how they re-order triangles tjunct_indices tjunct_real_example

For cp_coldfront all t-junction faces just re-order the original winding_t But presumably some maps use PRIMITIVE_VERTICES

snake-biscuits commented 11 months ago

Checking Team Fortress 2 for PRIMITIVE_VERTICES:

>>> import bsp_tool, os, fnmatch
>>> md = "D:/SteamLibrary/steamapps/common/Team Fortress 2/tf/maps"
>>> for m in fnmatch.filter(os.listdir(md), "*.bsp")
...     bsp = bsp_tool.load_bsp(os.path.join(md, m))
...     if bsp.headers["PRIMITIVE_VERTICES"].length > 0:
...         print(m[:-4])

Doesn't seem like any maps use the lump