BLOGGER TEMPLATES AND TWITTER BACKGROUNDS »

Wednesday, October 20, 2010

Select UV Border Edges

Selecting border edges for the most part is relatively easy, but if you have a model where an internal edge shares the same vertices as two border vertices, it will also select those edges (ex. - a square polygon subdivided diagonally across the center into triangles). This fixes that problem (as long as the object is bigger than a square, which 99% of the time it is) source

// select UV border edges and remove edges that share uvs with the borders
// thus eliminating any unwanted internal edges
string $currSelected[] = `ls -sl -o`;
string $temp[] = `ls ($currSelected[0]+".map[*]")`;
select $temp;
polySelectBorderShell 1;
PolySelectConvert 20;
string $potentialEdges[]=`filterExpand -ex 1 -sm 32`;
string $removedEdges[];
for($eachEdge in $potentialEdges)
{
string $uvs[] =`polyListComponentConversion -fe -tuv $eachEdge`;
$uvs = `ls -fl $uvs`;
if(size($uvs)<=2)
$removedEdges[size($removedEdges)] = $eachEdge;
}
select -d $removedEdges;

0 comments: