[TUTORIAL] Brush merging

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
This is a rather advanced technique, and isn't often needed or useful. I tend to use it in cases where an object can be better vertex manipulated if it's one brush. Remember that the resulting object still has to be a valid convex solid. This includes not having two faces lie on the same plane.

For the tutorial I made an odd conical shape out of three cylinders and a spike, don't ask what it is as I have no idea. :p

brushmerge01.jpg


First, copy the brushes to be merged to a new document. This will both ensure the safety of your original VMF, and make finding things easier.

brushmerge02.jpg


My object is made of four pieces, as you can see, and we need to differentiate between the inside faces that touch each other and the outside faces we see so we know what to remove. How many of each you have will determine which ones to change, I have 33 outside and 6 inside, so I'll change the insides. Material doesn't matter, for the tutorial I'm using nodraw on the faces to be removed.

brushmerge03.jpg

(brushes expanded to show what I did, keep them together for the next part)

Save the map, then open it in a text editor. If you've never done this before it can look complicated, but it's easy to follow once you learn to recognize pieces.

brushmerge04.jpg


First we want to locate and remove all the inside faces, and we do so with the help of the material property each face block has in the VMF.

brushmerge05.jpg


Here I've found a side with nodraw on it, so I know this is one I wanted to remove. Select the whole block, as I have in the picture, and delete it. Continue doing this throughout the whole document, use the find function to search for the material you used on the inside faces to ensure you don't miss any.

Right now we have a bunch of invalid brushes, since we removed some of their faces. So now we need to do the actual merging of the brushes. To do this we will locate and remove every start and end of brush data, except for the very first and very last.

brushmerge06.jpg


Save the document, open it in hammer, and you should have a single brush to copy back into your original map. :)

brushmerge07.jpg
 
Last edited:

Vander

L8: Fancy Shmancy Member
Feb 16, 2008
506
215
Very nicecly done. I had no idea you could edit in the actual text file.
 

Scotland Tom

L6: Sharp Member
Jan 19, 2008
332
64
Wow, that's fascinating. I wouldn't have ever thought you could edit a brush through text. Nice work, and very helpful!
 

Godling

L2: Junior Member
Oct 26, 2007
55
14
What can you do with the new object in Hammer that you couldn't have done with the original 4 part object? I don't get it?
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
What can you do with the new object in Hammer that you couldn't have done with the original 4 part object? I don't get it?
its tidyer, easier to texture, posibly quicker to compile (not sure on that one) easier to select....etc
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
I'll admit that yes, what I showed here is, in itself, nigh useless. I didn't have the time or interest to actually devise an example object that lets you do something afterwards that you couldn't before. I have ran into such in the past, but can't remember any of them.
This isn't so much something that you can tell someone what you can do with it, but rather you just end up running into a case where you instantly know you need this. (as I said in the tut, it's almost always a case of being able to VM the resulting object in ways you couldn't with a bunch)
 

Termaximus

L5: Dapper Member
Jan 11, 2008
229
32
"For the tutorial I made an odd conical shape out of three cylinders and a spike, don't ask what it is as I have no idea"

Looks like the Pope's hat. Nice tutorial, although a bit above my pay grade at this point.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
Update:
It's kinda outdated now since Hammer++ natively supports merging brushes...
A lot of features are built in to Hammer++ but it's not helpful to resurrect fourteen year-old threads for each of them.