Aligning Off-Grid Vertices and Brushes

KonstantinUb

L1: Registered
Dec 7, 2012
9
12
Vertices



Also, instead of using separate textures to highlight the faces on which the vertices are, you can find those faces in the text editor using their IDs. In the raw VMF file, these IDs are of the following form:
Code:
[FONT="Courier New"]side
{
        [B][FONT="Courier New"]"id" "5"[/FONT][/B]
        "plane" "(-1024 1024 1024) (-1024 -1024 1024) (1024 -1024 1024)"
        "material" "TOOLS/TOOLSNODRAW"
        "uaxis" "[1 0 0 -1024] 0.25"
        "vaxis" "[0 -1 0 -1024] 0.25"
        "rotation" "0"
        "lightmapscale" "16"
        "smoothing_groups" "0"
}[/FONT]
In order to get these IDs in Hammer, create an info_overlay and, under the “Brush faces” keyvalue, highlight the desired faces using the eyedropper. Their IDs will show up in the text field on the right, as can be seen here.



Brushes

This technique can also be applied to move whole brushes so that they're aligned to geometry that's off grid. Of course, in this case, you wouldn't replace each vertex's coordinates separately, but rather move the whole brush with CTRL+M using the decimal offset of the off-grid vertex whose coordinates you had read. For example, let's say I wanted to align the two brushes seen in this picture:



The distance d is how far the top brush needs to be moved down to meet the bottom brush, but we have no way of finding out how much that exactly is from within Hammer. This is where the technique from the video comes in handy.


1. We are going to start by copying the bottom shape and moving it to a separate VMF as shown in the video. Select the shape, CTRL+C it, open a new VMF and CTRL+SHIFT+V it in. Make sure that all settings in the paste special dialog are at their default values and that “Start at center of original” is checked.




2. Once the shape has been replicated in the blank VMF, we're going to want to highlight the face to which we want to align the top brush. We'll be doing this by applying a distinct texture to it using the SHIFT+A dialog.




3. Save the new VMF somewhere and then open it using a text editor (I'll be using Sublime Text 2 for this demonstration). Afterwards, do a search for the name of the special texture you applied.

Once you've found the face with the texture, look at the numbers above the material name. These are the coordinates of the three points (three vertices) that define the spatial plane on which the face lies. Since the face is horizontal and we need to move the top brush vertically down, we're going to be looking at the Z coordinates of the points. We find that these coordinates are 110.202, which is actually how high up the face itself is. If you were looking to align the brushes along the X or Y axes instead, you'd be checking the X or Y coordinates of the points, respectively.




4. From here we can work out what d is. Since we know that the face is 0.202 units away from the grid line directly below it (110), we know that we need to move the top brush 1 - 0.202 = 0.798 units down for them to meet.




5. We select the top brush and open the transformation dialog (CTRL+M). We select “Move” and type in -0.798 on the Z axis since we want to move the brush 0.798 units down. Voilà — the brushes are now perfectly aligned!

 
Last edited: