|
OpenBF1942-Plus
Refractor 1, rebuilt from scratch
|
Functions | |
| parse (d) | |
| parse_collision (b) | |
| triangles (m) | |
| to_obj (mesh, lod=0) | |
| parse_rs (text) | |
| export (vfs, mesh_path, out_dir) | |
Variables | |
| TRIANGLE_LIST | |
| TRIANGLE_STRIP | |
| int | COLLISION_MAGIC = 0xEB97C2FA |
| vm = load_mod(sys.argv[1], sys.argv[2]) | |
| mesh = export(vm.vfs, sys.argv[3], sys.argv[4]) | |
Reader for Refractor static meshes (.sm, versions 9 and 10). Stdlib only. Spec: docs/formats/sm.md Usage: sm.py <BF1942_DIR> <mod> <mesh> <out_dir> Export LOD 0 of e.g. standardMesh/willys_body_m1 as OBJ + MTL + textures (opens in Blender).
| sm.export | ( | vfs, | |
| mesh_path, | |||
| out_dir ) |
| sm.parse | ( | d | ) |
-> {version, bbox, collision: [bytes], lods: [[{name, prim, fvf, stride, alpha, vertices, indices}]], end}
| sm.parse_collision | ( | b | ) |
Collision block (also inside .tm) -> {vertices: [(x, y, z, material)], faces: [(a, b, c, material)], tree: bytes}.
The tree after the faces (spatial index) is kept opaque; physics can rebuild one from the triangles.
| sm.parse_rs | ( | text | ) |
.rs shader file -> {material name lower: {"shader": ..., key: value}}
| sm.to_obj | ( | mesh, | |
| lod = 0 ) |
| sm.triangles | ( | m | ) |
| int sm.COLLISION_MAGIC = 0xEB97C2FA |
| sm.mesh = export(vm.vfs, sys.argv[3], sys.argv[4]) |
| sm.TRIANGLE_LIST |
| sm.TRIANGLE_STRIP |
| sm.vm = load_mod(sys.argv[1], sys.argv[2]) |