Go to: Synopsis. Return value. Keywords. Related. Flags. MEL examples.

Synopsis

untangleUV [-mapBorder string] [-maxRelaxIterations int] [-pinBorder boolean] [-pinSelected boolean] [-pinUnselected boolean] [-relax string] [-relaxTolerance float] [-shapeDetail float]

untangleUV is undoable, NOT queryable, and NOT editable.

This command will aid in the creation of non-overlapping regions (i.e. polygons) in texture space by untangling texture UVs. This is done in two stages:
1) Use this command to map the UV border determined by the current selection or passed component into a shape that is more suitable for subsequent relaxation.
2) Relax all the internal texture UVs by performing a length minimization algorithm on all edges in texture space.

Return value

int the number of relaxation iterations carried out

Keywords

poly, uv, map, border, relax, untangle

Related

polyClipboard, polyCylindricalProjection, polyEditUV, polyForceUV, polyMapCut, polyMapDel, polyMapSew, polyMoveFacetUV, polyMoveUV, polyPlanarProjection, polyProjection, polySphericalProjection, polyUVSet

Flags

mapBorder, maxRelaxIterations, pinBorder, pinSelected, pinUnselected, relax, relaxTolerance, shapeDetail
Long name (short name) Argument types Properties
-mapBorder(-mb) string create
Map the border containing the selected UV into a variety of shapes that may be more amenable to UV relaxation operations. There are various types of mapping available. All the resulting mappings are fit inside the unit square.

Valid values for the STRING are:
circular - a circular mapping with picked UV closest to (0,0)
square - map to unit square with picked UV at (0,0)
shape - a mapping which attempts to reflect the actual shape of the object where the picked UV is placed on the line from (0,0) -> (0.5,0.5)
shape_circular - shape mapping which will interpolate to a circular mapping just enough to prevent self-intersections of the mapped border
shape_square - shape mapping which will interpolate to a square mapping just enough to prevent self-intersections of the mapped border
-shapeDetail(-sd) float create
If the mapBorder flag is set to circular or square, then this flag will control how much of the border's corresponding surface shape should be retained in the final mapped border.
-relax(-r) string create
Relax all UVs in the shell of the selected UV's. The relaxation is done by simulating a spring system where each UV edge is treated as a spring. There are a number of different methods characterized by the way the UV edges are weighted in the spring system. These weightings are determined by STRING. Valid values for STRING are:
uniform - every edge is weighted the same. This is the fastest method.
inverse_length - every edge weight is inversely proportional to it's world space length.
inverse_sqrt_length - every edge weight is inversely proportional the the square root of it's world space length.
harmonic - this weighting can yield near optimal results in matching the UV's with the geometry, but can also take a long time.
-relaxTolerance(-rt) float create
This sets the tolerance which is used to determine when the relaxation process can stop. Smaller tolerances yield better results but can take much longer.
-maxRelaxIterations(-mri) int create
The relaxation process is an iterative algorithm. Using this flag will put an upper limit on the number of iterations that will be performed.
-pinBorder(-pb) boolean create
If this is true, then the relevant texture borders are pinned in place during any relaxation
-pinSelected(-ps) boolean create
If this is true, then then any selected UVs are pinned in place during any relaxation
-pinUnselected(-pu) boolean create
If this is true, then all unselected UVs in each mesh are pinned in place during any relaxation

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

untangleUV -mb shape_square;
// map the border associated with the selected UV trying to retain the
// shape of the object and use a square mapping to iron out crossings
untangleUV -r one_over_length -pb true -ps false -pu false -rt 0.1;
// relax the shell associated with the selected UV using edge weights
// that are inversely proportional to length of world space lengths
// pin the UV on borders and use a tolerance of 0.1