set_visgroup
Assign brushes to a named visgroup, creating it if needed, or remove them — writes both the declaration and each brush's membership so Hammer keeps the grouping after reopening.
Instructions
Puts brushes in a named visgroup, creating it if it does not exist, or takes them out. This is what gives a selector a durable name: once 'north tenement' is in the file, every later call can say owner or ids without a bounding box typed from memory. Both halves are written -- the declaration in the visgroups block and the membership in each brush's editor block -- because Hammer drops a membership whose visgroup is not declared, without a word, the next time it opens the map. A brush may be in several visgroups at once, which is the normal case and not an error.
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>",
"name": "<name>"
},
"name": "set_visgroup"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Visgroup name, as Hammer's tree shows it. | |
| path | Yes | Path to the .vmf, absolute or relative to the repo root. | |
| color | No | Editor colour, 'r g b'. Default '255 255 255'. | |
| owner | No | 'world', or a brush entity classname. | |
| 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. | |
| remove | No | Take the brushes out instead of putting them in. | |
| within | No | ||
| confirm | No | Required (true) to run this tool: it writes or executes. | |
| material | No | Brushes carrying this on at least one face. | |
| solidIds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| created | Yes | ||
| written | Yes | ||
| nextStep | Yes | ||
| warnings | Yes | ||
| unchanged | Yes | ||
| backupPath | Yes | ||
| visgroupId | Yes | ||
| solidsChanged | Yes |