PDA

View Full Version : Sub-D Edge Loop Tool


orbitalpunk
10-07-2005, 11:33 AM
Hi there,

I've been trying to modify MJ's Polytools Edge loop script to work with a Sub-D Edge. Its seems like it should work but im getting errors. I did change the selection mask ID from poly edge (32) to Subdivision Mesh Edges (37) but still doesnt work. Could somone have a look? cause if you change the 37 back to 32, i will work. but again, trying to use this for a sub d edge.

Thanks

{

string $E[] = `filterExpand -sm 37`;

for ( $Ed in $E )
{
$Edge = $Ed;

string $EdgeList[];
string $loopVertex;
string $loopEdge;
int $i = 0;
int $a = 0;

string $Verts[] = edge2Vertex($Edge);

$loopEdge = $Edge;
$loopVertex = $Verts[1];

$EdgeList[$i++] = $loopEdge;

int $stop = 0;
while ( $stop != 1 )
{

string $AllFaces[] = vertex2Face($loopVertex);
if ( size($AllFaces) != 4 ) { $stop = 1; break; }

$loopEdge = getOppositeEdgeFromVertex( $loopEdge, $loopVertex );
$loopVertex = inverseVertexFromEdge( $loopVertex, $loopEdge );

if ($loopEdge == $Edge ) { $stop = 1; $a = 1; break; }

$EdgeList[$i++] = $loopEdge;

}
select -add $EdgeList;


string $EdgeList[] = inverseArray($EdgeList);
$loopEdge = $Edge;
$loopVertex = $Verts[0];

$stop = 0;
while ( $stop != 1 )
{

if ( $a == 1 ) { $stop = 1; break; }

string $AllFaces[] = vertex2Face($loopVertex);
if ( size($AllFaces) != 4 ) { $stop = 1; break; }

$loopEdge = getOppositeEdgeFromVertex( $loopEdge, $loopVertex );
$loopVertex = inverseVertexFromEdge( $loopVertex, $loopEdge );



$EdgeList[$i++] = $loopEdge;


}
select -add $EdgeList;
}

}

CGTalk Moderation
10-07-2005, 11:33 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.