UVWeld and SMart-UV tools updated for blender 2.45 compatability

I’m posting this here mainly because there was some interest in seeing the UV-Welder and “Smart” UV alignment tools updated for the current version. We still use them in-house quite a lot at our small game dev company, so here they are.

http://members.cox.net/vexgames/uvtools.zip

Its a set of two tools that basically form a powerful tag-team when working with angular, mechanical UV maps with lots of repeats / overlap in blender. Things like spaceships, mechanical parts, buildings, architecture, that kind of things. Not very useful for biological shapes.

Smart UV
Before Smart-UV:
http://members.cox.net/vexgames/smartuv_before.gif

After Smart-UV
http://members.cox.net/vexgames/smartuv_after.gif
What it basically does is try to make as many edges of each UV island aligned horizontally or vertically. In more details, it assigns a ‘score’ to each possible alignment, giving it bonus points for long straight lines horizontal or vertical, and then chooses the alignment that gives it the highest score for all available rotations. Operates on selected UV islands.

Note that it moves the island centroids to be aligned with the UV grid, so you can hold CTRL down when you move them to drop them perfectly on top of each other. It works on all sorts of shapes, although you might need to mirror them, then smart-uv again to get the desired effect.

UV Welder
It basically performs a ‘remove doubles’ type operation on the UV map. You feed it a threshhold, it averages the positions of the nearby vertices within that threshhold. It can save you an enormous amount of time if you have to be precise. For example, lets say I took the above squares and just dropped them on top of each other as best as I could (without using snap).

before uv welder
http://members.cox.net/vexgames/uvwelder_before.gif

After UV welder
http://members.cox.net/vexgames/uvwelder_after.gif

Both plugins benefit from psyco if installed (but not manditory).

Feel free to alter these or distribute them or whatever. I don’t really care. Whatever helps you work on your meshes in blender.

If you’re interested in how to find UV islands, rotate or manipulate UV’s, weld or average vectors, etc, it also serves as a starting point.

Workflow

My usual workflow when it comes to unwrapping an angular object (such as a gun or something)

  • Mark seams
  • Unwrap (using LSCM, conformal mode, or risk stretching! Remember, its a new button in the interface!)
  • Spread the parts that are touching apart somewhat so that Smart-UV doesn’t think they’re part of the same island.
  • Smart-UV
  • Drag and drop the parts ontop of each other using CTRL (for the parts I want face-mapped or parts that I’d like to share the same UV coordinates). This might require some mirroring, and re-use of Smart-UV.
  • Scale a bit.
  • Any uneven parts that dont quite fit due to meshing differences, but I still want to use the same UV real estate, I drag as close as I can, then us UV-Welder on. I also use it on parts that Smart-UV was unable to fully line up. Its not 100% perfect.

Edit:
Heres a preview of how it works on more advanced UV island shapes.

Before Smart-UV:
http://members.cox.net/vexgames/complex_before.gif

After Smart-UV:
http://members.cox.net/vexgames/complex_after.gif

Note that because the shapes are identical, they tend to become aligned identically after Smart-UV because the fitness score given to that particular rotation will be the highest in both shapes.

Since it also aligned their centroids with the grid, I can L (select linked) over one of the islands, then drag it (using CTRL for snap) onto the other one, and it will perfectly align.

thanks a lot, I still wonder why these scripts aren’t in the blender installation.

Really nice! I’ve wanted something like this for some time. And yes, these scripts should be in the Blender installation, just great.