set_face_material
Assigns a material to selected .vmf faces filtered by solid, existing material, facing or area, normalizing the name to the form vbsp expects and optionally backing up or dry-running the write.
Instructions
Sets the material on selected faces of a .vmf. Until this existed a brush's material was fixed at creation and nothing could change it, which made set_lightmap_scale the odd position of being able to say how finely to light a wall but not what the wall was made of. Selects by solid, material, facing or area. The name is normalised to the form a .vmf stores -- uppercase, no materials/ prefix, no .vmt suffix -- because vbsp resolves it literally and a wrong one is invisible until a player loads the map. Whether the material exists is NOT checked here: use read_game_content for that.
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>",
"newMaterial": "<newMaterial>"
},
"name": "set_face_material"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Every face of the map. Required when no other criterion is given. | |
| path | Yes | Path to the .vmf, absolute or relative to the repo root. | |
| 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. | |
| 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. | |
| newMaterial | Yes | Material to apply, in any of the usual forms. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| changed | Yes | ||
| matched | Yes | ||
| written | Yes | ||
| nextStep | Yes | ||
| warnings | Yes | ||
| unchanged | Yes | ||
| backupPath | Yes |