biorhythm
11-03-2007, 07:56 PM
Hello,
Im curious howto query the type of polygon components in a current selection?
Purpose being, I want to run a procedure and/or loop if the current selection(or first element in array) is a poly edge, so how do i go about this? So far I figure the following will suffice, although it seems somewhat of a hack and wonder if a method with more finesse exists? Perhaps a 'type' to use with 'ls -type' or even a command to query/list selected component types...
{
string $selectedEdges[] = `filterExpand -sm 32` ;
if(size($selectedEdges)!=1)
error "please select 1 polygon edge" ;
"else, run procedure"
}
also, as a less definitive approach, the following:
{
string $selectedEdges [] = `ls -sl -fl -type float3`;
if(size($selectedEdges)!=1)
error "please select 1 polygon edge" ;
"else, run procedure"
}
However as 'float3' refers to edge and vertex(possibly more?) this is could be cumbersome.
So far I've looked at threads such this, but don't seem to get the logic, in the following its the " if (`match "\.vtx" $selection[$i]` == "\.vtx") " line that gets me...
http://forums.cgsociety.org/showthread.php?f=89&t=111233&highlight=determine+selection+type
Any ideas or feedback are greatly welcomed, and as always, thanks in advance
Julz
:)
Im curious howto query the type of polygon components in a current selection?
Purpose being, I want to run a procedure and/or loop if the current selection(or first element in array) is a poly edge, so how do i go about this? So far I figure the following will suffice, although it seems somewhat of a hack and wonder if a method with more finesse exists? Perhaps a 'type' to use with 'ls -type' or even a command to query/list selected component types...
{
string $selectedEdges[] = `filterExpand -sm 32` ;
if(size($selectedEdges)!=1)
error "please select 1 polygon edge" ;
"else, run procedure"
}
also, as a less definitive approach, the following:
{
string $selectedEdges [] = `ls -sl -fl -type float3`;
if(size($selectedEdges)!=1)
error "please select 1 polygon edge" ;
"else, run procedure"
}
However as 'float3' refers to edge and vertex(possibly more?) this is could be cumbersome.
So far I've looked at threads such this, but don't seem to get the logic, in the following its the " if (`match "\.vtx" $selection[$i]` == "\.vtx") " line that gets me...
http://forums.cgsociety.org/showthread.php?f=89&t=111233&highlight=determine+selection+type
Any ideas or feedback are greatly welcomed, and as always, thanks in advance
Julz
:)
