align_faces
Realigns texture on selected VMF faces to world, face, fit, or arc modes, recomputing offsets from a face corner to avoid stale-offset misplacement.
Instructions
Realigns the texture on selected faces: to the world axes, to the face's own plane, or stretched to fit the face. Hammer's three alignment modes. 'world' derives the axes from the face's dominant normal using vbsp's own base-axis table, which is what a face gets at creation; 'face' projects them into the face's plane so the texture runs along a slope instead of being squashed onto it; 'fit' spans the face exactly. The offsets are always recomputed from a corner of the face rather than carried over -- an axis pair with a stale offset puts the texture somewhere else entirely, which is the most common way an alignment tool produces a map that compiles and looks wrong.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"mode": "<mode>"
},
"name": "align_faces"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Every face of the map. Required when no other criterion is given. | |
| mode | Yes | 'arc' is 'face' plus continuity: facets that touch without turning a corner are one run, and each carries its texture on from where the last one stopped. It is what a curve needs and what neither of the others gives -- a ring aligned to 'face' restarts the brick at every seam, which reads as flat plates however well the smoothing groups are set. | |
| path | Yes | Path to the .vmf, absolute or relative to the repo root. | |
| scale | No | Multiply both texture scales by this afterwards. Zero is refused. | |
| shift | No | Add to the u and v offsets, in texels. | |
| backup | No | Copy the file to <file>.bak before writing. Nothing is copied on a no-op. | |
| dryRun | No | Check and report without writing. Every verification runs either way. | |
| facing | No | Only faces pointing this way. 'up' is a floor, 'down' a ceiling, 'side' a wall; the cut is at 45 degrees, so a ramp counts as what it is closer to being. | |
| repeat | No | For 'fit': how many times the texture repeats across the face. Default once. | |
| rotate | No | Turn the axis pair in the face's plane, degrees. | |
| confirm | No | Required (true) to run this tool: it writes or executes. | |
| minArea | No | Only faces at least this large, in square units. | |
| material | No | Only faces already carrying this. Substring, case-insensitive. | |
| solidIds | No | Only faces of these solids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| changed | Yes | ||
| matched | Yes | ||
| written | Yes | ||
| nextStep | Yes | ||
| warnings | Yes | ||
| unchanged | Yes | ||
| backupPath | Yes |