[Bf-funboard] Improving the uv editor

Brecht Van Lommel bf-funboard@blender.org
01 Feb 2004 23:10:07 +0000


Hi,

It's clear that currently, the uv editing tools are very basic. They
just do what they have to do, but we're missing tools that make things
easier and do specific uv editing tasks. Bjornmose already started some
great work on this, and I'm going to code on the uv editor too. I don't
think it's wise to just start adding tools randomly, so I want your
opinion in this. I've read William Reynish' proposal, and I might have
took some of his ideas :). I'll also apologize for my limited english
vocabulary and any other grammar mistakes.

We could also use some more advanced unwrapping tools, but I'm not going
to discuss that here. I've searched for solutions, and I think I found
one too: http://www.loria.fr/~levy/Graphite/. The main author even
offered to help with integrating it into Blender, so that's pretty
great. If I would do this, it might take quite some time, and this is
not something I could just decide on my own. The code of Graphite
however is nicely clean and modular, which would facilitate the work.

Selection Tools

You probably know it's not easy to get the right tex vertices selected.
We need the ability to select them both in the 3d view and the image
window. Why not allow you to do this with the LMB? You don't need it in
faceselect mode. Ok, you can grab/scale/rotate the whole mesh relative
to the 3d cursor in faceselect mode, but noone goes into faceselect mode
to do this, right? A modifier key could be used instead, for
consistency's sake.

You also often need to select all tex vertices that are on top of each
other in the image window. Why not use LMB here too? There isn't even a
3d cursor in the image window.

Sometimes you also want to select exactly one tex vertex, but you can't
because there are other tex vertices in the same place. I've got a kind
of hackish tool for this. What is basicly does is that is scales down
all faces individually by 10%, so you can clearly see which tex vertex
belongs to which face. When you apply this tool again, it will scale up
everything by 10%. This isn't really great, since it changes the data
for a selection, which is quite unexpected behaviour, but it works for
me. 

Bf-Blender Patch (current hotkey is 'M'):
http://users.pandora.be/blendix/blender/patch_show_doubles.txt

As you're often working with 'Altas' uv maps, you want to select
complete 'Islands'. This is what the Island Select tool is for. It kind
of works like Select Linked in the 3d view. There's one problem for this
however, and I have this problem too with other tools. As no texture
faces are really connected, you need to check the distance between them.
But how do you choose this distance? It isn't really practical to ask
for it with every tool you use. I think it would be best to add a
numeric value input to bjornmose's uv panel in the buttons window, so
it's value can be used by all tools.

Bf-Blender Patch (look in the image window menu's):
http://users.pandora.be/blendix/blender/patch_heal_link.txt

Sometimes you want to take a piece of an Island and move it somewhere
else. I made an 'Unlink Selection' tool that, based on an existing
selection, only selects those faces that have all tex vertices selected.
This tool is in the previous patch.

You might also want to select faces in the image window instead of the
faceselect mode. A hide/unhide function for the image window should
solve this.
Bf-Blender Patch (same hotkeys as in 3d view):
http://users.pandora.be/blendix/blender/patch_heal_link.txt

Merging and Stitching

When you're manually moving around tex vertices you often want to
'merge' them in the same place. This is what the Heal UV tools is for
(name taken from Softimage, it doesn't really explain the
functionality). It 'merges' all selected tex vertices together that
share the same vertex. It can also work based on distance, if you want
to 'globally heal' the uv map. It can be used when stitching two islands
together.

Bf-Blender Patch (look in the image window menu's):
http://users.pandora.be/blendix/blender/patch_heal_link.txt

Distortion/Stretching

Until there is a 'relax uv' tool (multiple of these algorithms are
avaible in Graphite), we can offer tools for manually resolving this. It
would be nice if these distortions could be visualized in the image
window. Length distortion could be visually represented (when activating
a function in the view menu) by giving each face a color based on it's
distortion. Angular distortion can be visualised pretty much the same
way, but by using different vertex colors in each angle. One problem
here is that you have to calculate this distortion based on a global
scale. If the user decides to give two islands a different scale, the
islands will be colored because they are considered distorted. This
isn't really a problem, because as long as one island has the same
colors, you know it isn't distored. This coloring also comes in handy to
give islands exactly the same scale.

Drawing alpha'd faces without distortion colors is also usefull, to see
if there are any overlapping faces.

To manually correct distorion on organic shapes, a proportional editing
tool in the image window could be handy too. A built-in checker map
would be nice also.

Undo

The reason for this is obvious. I've already made a preliminary, but
working patch based on the undo system from editmode. Currently it only
works in the image window, and it has one major problem. The undo stack
get's lost when you leave faceselect mode. I often go into editmode to
use some of it's advanced selection tools, and I want to use them too
when working on the uv map. So I will need to find a system that will
get rid of the undo stack only when a face has been added to or removed
from the mesh (otherwise the undo stack is not valid anymore). I'm still
figuring this out, and I'll need to look seriously into the editmode
code for this. The editmode's undo system gets in the way quite a bit
here, cause I need to figure out somehow when undoing/redoing an action
will add/remove a face to/from the mesh.

Bf-Blender Patch (same hotkeys as in 3d view):
http://users.pandora.be/blendix/blender/patch_undo.txt

Other Problems

I don't have any concrete plans for these problems, but I'll probably
investigate these once I've done the other tools (or, of course, leave
them to someone else, as there seem to be more people interested in
improving uv editing).

Faceselect mode needs some better draw modes. The plain white (and
sometimes purple) faces don't show the topology of the mesh. Also tex
vertices / faces selected in the image window should be visualised in
the 3d view somehow.

Show a shadow of non-selected faces in the Image window. Bjornmose
already did this :). 

I can't seem to be able to mirror the tex vertices, have really looked
for this in the code, but I don't think it's possible. Grab/Scale/Rotate
tools might need to be improved as in the 3d view.

The ability to have multiple uv maps per mesh would be sweet, but I need
to change the mesh data struct for this. I don't feel confident for
doing this right know, but I'll keep it somewhere in the back of my
head.

So that's it. Suggestions very welcome. I'll post more patches here (and
submit them to bf-commiters once Blender 2.32 is out, don't want to be
in the coders way right now :).

Cheers,
Brecht