model/vmf: Hammer VMF read and write (Brush solids with Valve 220 axes, displacements, entities, cameras, visgroups, byte-exact write back, document builders); KeyValues: escapes = "quotes", bare / flat block layout for writing

This commit is contained in:
4DBug committed 2026-11-01 19:15:54 -06:00
1 parent c30e8618fc
commit e4840b719b
17 files changed
+4075 -1443

No files matched your search

+6 -4
View File
@@ -1,9 +1,10 @@
# Docs inputs for the Source engine sections of the scene page (tools/fixtures.py; tools/docs_check.py explains the
# inputs): the CS:GO-style VBSP of tools/fixtures/vbsp.py (srctools-saved, static props v11).
# tests/gen/docs_source.luau { files = { [name] = bytes }, vars = { vbspBytes = "room.bsp", ... } }
# inputs): the CS:GO-style VBSP of tools/fixtures/vbsp.py (srctools-saved, static props v11) and the Hammer VMF of
# tools/fixtures/vmf.py.
# tests/gen/docs_source.luau { files = { [name] = bytes }, vars = { vbspBytes = "room.bsp", vmfText = "room.vmf" } }
import importlib.util, json, os
INPUTS = ["tools/docs_check.py", "tools/fixtures/vbsp.py"]
INPUTS = ["tools/docs_check.py", "tools/fixtures/vbsp.py", "tools/fixtures/vmf.py"]
def mod(ctx, name):
@@ -16,4 +17,5 @@ def mod(ctx, name):
def generate(ctx):
res = json.loads(ctx.python(["srctools"], mod(ctx, "vbsp").CODE))
files = {"room.bsp": next(bytes.fromhex(c["data"]) for c in res["cases"] if c["name"] == "csgo")}
mod(ctx, "docs_check").emit_inputs(ctx, files, {"vbspBytes": "room.bsp"})
files["room.vmf"] = mod(ctx, "vmf").room().encode()
mod(ctx, "docs_check").emit_inputs(ctx, files, {"vbspBytes": "room.bsp", "vmfText": "room.vmf"})