UVuniform SOP

Overview

This sop automatically modifies point uv positions to remove distortion in the uv mapping. To do this it first calculates the amount of distortion by comparing the relative edge lengths in uv space to those in object space. I.e a short edge in the model should also be short in uv space, and a long edge should be likewise long in both spaces. Once the distortion is calculated a uniform grid is modified in uv space to match the distortion. This modified grid is then used as a mapping to move the original uv's to a position where there is less distortion.

This sop also allows you to visualise both the amount of detected distortion by colour coding, and the distorted grid mapping that is used to rectify the distortion.

Usage

Apply to any model that has existing uv's.  Particularly useful for applying after a uvpelt operation.
The existing uv's must lie in the range 0-1.

Parameters

Max iterations The maximum number of iterations used to calculate the distortion. The algorithm will terminate before this value if it has found the optimum solution.
Retransfer every # Used in conjunction with fast mode this will check the amount of distortion still left after # number of iterations. If fast mode is off this check will happen every iteration, which is more accurate but slower.
Max edges to search The number of edges to search through when checking what polygon in uv space a grid point is in. If the polygon can't be found after this number of searches it is assumed to lie outside the uv space of the model. Generally the correct polygon will be found within a few steps but sometimes it will take many more.  Low numbers are quicker but less accurate, the maximum this number ever needs to be is the total number of edges in the input model.
Amplify effect A scale factor that lets you remove or add to the final uv positions.
Grid detail Generally this should be left at 2. The grid size is determined by the length of the edges in uv space. Changing this value may lead to excessive cook times if too high, or inaccurate results if too low.
Bounding scale Effects the over all size of the grid. The grid should always be slightly larger than the uv space. The grid size is calculated automatically and should be ok with this value at 1.
U out range Ouput U range - fit the calcuated u value to this range
V out range Output V range - fit the calcuated v value to this range
Freeze attribute Name of an attribute that can be used to freeze points to stop them being effected by the uniforming process. The attribute should be a float with a value between 0 and 1
Fast mode See "Retransfer every #".
Visualise uv distribution Colour code points to show the amount of distortion
Visualise smoothing grid Show the distortion grid in object space.