Script written by Christian Stejnar
provided by: Chris Wells
Correspondence collected by:
Dru Abrams
dru@persistentvisions.com

/hi,
//
//i attached some mel-code which could help. it swaps uv position between 2 or 3 uvs/vertices.
//you can also select a face - and all vertices are swaped. HTH.
//
//chris
//
//======================================================
string $convertCmd = `PolySelectConvert 4`;
string $uvData[] = `ls -sl -fl`;
string $uvTransfer[];
string $uvNew[];

int $u = 1;
int $plusCount;
int $uvCount;

float $uvPosition[];

//just get the position of the UVs stored in $uvTransfer...
for ($selIndex = 0; $selIndex < size($uvData); $selIndex++)

{
clear $uvPosition;
$uvPosition = `polyEditUV -r false -q $uvData[$selIndex]`;
$uvTransfer[$selIndex] = (" -u " + $uvPosition[0] + " -v " + $uvPosition[1]);
}

//renumber the UVs
$uvCount = size($uvTransfer);
for ($selIndex = 0; $selIndex < $uvCount; $selIndex++)
{
$plusCount = $selIndex + $u;
if (($plusCount + 1) > $uvCount) $plusCount = 0;
$uvNew[$selIndex] = $uvTransfer[$plusCount];
}

//assign the new positions
for ($selIndex = 0; $selIndex < size($uvData); $selIndex++)
{
select $uvData[$selIndex];
$cmd = "polyEditUV -r false " + $uvNew[$selIndex];
$newCmd = eval ($cmd);
}

select $uvData;
//======================================================
//-------------------------------
//Christian Stejnar
//System Administrator
//
//neo Software Produktions GmbH
//A T2 Company
//email: christian.stejnar@neo.at
//web: http://www.neo.at