## Facilities of the Tag Side Plugin

Intended for Quark 5.11 (works with 5.10)

The Tag Side plugin performs a variety of functions revolving around the `tagging' of a face, to use as a basis for other operations, such as snapping another face into alignment with it, or wrapping a texture from it onto other faces.

The version described here is beta, intended for release with Quark 5.11; for use with Quark 5.10 it requires the included revisions of qmaphandles.py and qbaseeditor.py, which go into the quarkpy folder.

Contents:

1. Basic Tag and Glue
2. Texture Wrapping
3. Linking
4. Changes from q5.10

### Basic Tag and Glue

The most basic operation is to first tag a face, with the right mouse menu for faces, and then select another face, and click on the `glue to tagged' command on the right mouse menu. The selected face will then snap to the position of the tagged one. This command is useful for getting things into alignment, especially off the grid.

Below the `Glue to Tagged' item is a submenu `More Tagging', which offers additional commands:

- Add to tagged - the selected face will join the currently tagged face(s) to form or enlarge a set of tagged faces, which is useful for various things.
- Removed from tagged - the selected face is removed from the tagged set.
- Clear tag - all tags are erased
- Select tagged list - the tagged list becomes the multi-selection. This can be useful if you want to make a multi-selection of faces from different brushes, since you otherwise you need the tree-view to do this (if you have a face selected, to select one from another brush you have to select that brush, which looses your face selection).

So far we've only looked at the face menu. Tag Side also puts commands on the speedmenus for other things, such as vertices.

Vertices have Tag Point and Glue to Tagged, and vertices can be glued to each other and to faces, and vice-versa. For example, if you have a downward-sloping brush that is functioning as a ramp, and you want to align level surfaces precisely with the top and bottom of the ramp, you can tag the upper vertices, and glue the top of a brush to them. Empty points in space can also be tagged (the background menu), tho I'm not sure at this how point useful this really is.

A more complicated command on the vertex menu is `align face to tagged'. If you tag a face, then select a side (left mouseclick its handle), then the `align selection to tagged' command will appear on the speedmenu of the face's vertices. This will swivel the face around the vertex so that it is parallel to the tagged face. This can be used to aligh the ceiling of a sloping tunnel exactly parallel to the floor.

Finally there are some commands on the speedmenu for polys:

- Glue Linked Faces - covered later, when we talk about linking.
- Merge Polys - you can merge brushes that `kiss' at a face (the polys each have a brush with the same location, orientiation, size and shape, but pointing in opposite directions), as long as this won't change the overall shape or create an invalid poly. To use it, tag the kissing face in one of the brushes, and select the other brush, and if everything is cool the menu item should become enabled.
- Cut poly along along tagged - So you can use some face of a brush as a cutting plane for other polys.

### Texture Wrapping

The next submenu we'll look at is concerned with `texture wrapping', fitting textures across more than one face without seams; perhaps with a bit of fitting as well. The commands of the Texture Wrapping submenu are:

- Wrap texture from tagged - copies the texture from the tagged face onto this one, so that there are no seams where the faces meet. No scaling or distortions are performed. This is fine for wrapping a texture around a vertical edge, but would work out for say an obelisk.
- Wrap texture around pillar - Tag a face that's the side of a pillar, then select the one next to it. The texture on the tagged face will be wrapped all the way around the pillar, in the direction of the pillar, and scaled to fit seamlessly. This only works if the edges where the faces to be wrapped around are all paralell (the whole pillar can however be at a slant). When the operation can't be performed, the item is disabled.
- Fit texture across tagged - this is a bit like the pillar wrap, but here you tag a set of faces (using Add to tagged from the More tagging submenu), the select one at either end. The texture of that face is than propagated across to the other end, and scaled so that it fits a full number of times across all the faces. Like the pillar wrap, this only works if the edges joining the faces are all paralell, and is disabled if it can't work.
- Project texture from tagged - this is a new one. Suppose want to wrap a meshlike texture over a bunch of random faces making various angles with each other (like a mesh stretched over a jumble of stuff). None of the above methods will work, but this will. The texture of the tagged face is projected onto the selected face, so that a texture is projected from one face to several faces hooked up in complicated ways, it will seem to be wrapped smoothly over all of them. So that for example you can do a four-sided obelisk by projecting textures from parallell brushes that project onto the obelisk faces but are ignored for building the map. I think I've fixed the problem that making things not work if the projected-from brush wasn't big enough.

There are also two options on the menu, the useful one is `preserve aspect ratio'; if this is checked, the fitting operations resize the textures evenly in all dimensions to make them fit in the pillar wrap and fit across tagged operations; otherwise they are just stretched in the direction required. The other one is `shift tag to selected', which might causes the selected tagged to become the tagged face in the Wrap texture from tagged operation.

### Linking

Linking is also new and rough around the edges; it's purpose to make `permanent glue', so that faces that are meant to stay stuck together are more likely to do so. The `Glue to tagged' command will link the glued and glued-to faces if the `Link on Glue' option from the Options menu is checked (by default it isn't, since this is new behavior). When faces are linked, various things happen:

- If one of the faces, or a poly, group or entity containing one of the faces, is dragged, then all of the faces linked to that face are dragged along too.
- If some operations other than dragging result in some linked faces no longer being coplanar, they are all drawn in dotted red (and it's easy to get the coplanar again). If one of them is selected, then it and those coplanar with it are drawn in dotted blue instead (doesn't always work).

The `Linking' submenu for faces provides control over linking effects. Its commands are:

- Glue linked faces - all faces linked to the selected one are glued to it. This is the basic technique for fixing things up when linked faces become unaligned (there are many different things that can cause faces to move in Quark, and it's probably not sensible to try to track them all automatically, and very un-sensible to assume that you're doing it successfully ..).
- Select linked faces - all the faces that are linked to the selected one become a multi-selection. This gives quick access to the face-rotating handles.
- Unlink face - the selected face is detached from the others it's linked to.
- Unlink all - all the faces linked to the selected face are unlinked from each other.
- Link face to tagged - links the selected face to the tagged one, without moving it (so the dotted red lines appear). I'm not sure if this one has a legitimate use, maybe it will disappear.

There are also two more options in the Options menu:

- Glue linked on drag - when something is dragged, things linked are dragged with it. On by default. If it's off, dragging something away from what it's linked to produces the dotted red lines.
- Multiselect on linked drag - if this is checked, the stuff that's dragged on a linked drag becomes the multiselection (Quark does spontaneously for some reason, I'm not sure if it's useful, but I decided to make turning it off optional).

  There is also a linking item on the speed menu for polys, groups and brush-entities, `Glue Linked'. This causes all the faces linked to some face in the group or whatever to snap to that face (for fixing things up when movements get linked faces out of alignment).

  ### Changes from q5.10

  New commands are:
  - Everything on the Linking submenu and relevant options
  - Cut poly along tagged
  - Merge Polys
  - Project texture from tagged.
  And there is one significant change in behavior: previously, the texture wrap operations copied all of the content and surface features as well as the texture name and alignment info; now they only do the latter. I regard the earlier behavior as a bug rather than a feature, but if you disagree, we can work something out.