polyListComponentConversion internal selection

polyListComponentConversion internal selection

Craig_Lamorte
Advocate Advocate
987 Views
3 Replies
Message 1 of 4

polyListComponentConversion internal selection

Craig_Lamorte
Advocate
Advocate

I have been trying to use the polyListComponentConversion - I am taking the face of a plane and converting it to edges with the internal flag on

 

cmds.polyListComponentConversion(faces, fromFace=True, toEdge=True, internal=True)

 

However it does not select just the internal edges, it also selects all the border edges of the face.  How can I get this command to work right?

 

Thanks

Craig

0 Likes
988 Views
3 Replies
Replies (3)
Message 2 of 4

Craig_Lamorte
Advocate
Advocate

Another thing I noticed is that when i test this using a plane with some subdivisions on the face... if I do fromFace and toEdge and us the border flag then it does not select any edge.  And again if I just do the internal flag it selects all the edges.  Shouldn't the border command select the border edges, and internal command select just the internal edges?  

 

If that is not the case what command could I use to just select the internal edges (I want to just delete the internal edges)

0 Likes
Message 3 of 4

Craig_Lamorte
Advocate
Advocate

more clarification - if take a plane with a bunch of subdivisions and instead of selecting all the faces, I select just the faces in the center and none of the faces that touch the border edge.  If I do this then polyListComponentConversion will work properly and select the internal or border edges.  It does not work properly it seems when selecting all the faces of a plane.  Is this a bug ?

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi Craig

 

I don't think this is a bug pe se, but it is a by-product of the logic used in calculating whether an edge is internal or not.

 

From the documentation, the internal flag specifies this:

 

"Indicates that the converted components must be totally envolved by the source components"

 

What that says to me is that an edge will be considered internal if your selection contains all the faces that share it. In the case of a standard edge, that would require 2 faces to be selected (The ones either side of the edge). But with a border edge, there is actually only 1 face associated with the edge (hence it being a border edge) and so the internal logic returns true in that case.

 

To get around this I would suggest that you simply need to store all border edges on the mesh and then subtract them from the final selection. Here is an example of how you might do that (Sorry I wrote it in MEL but I find it a bit quicker for these simple scripts. It should be very easy to re-write in python though)

 

string $sel[] = `ls -sl`;
polySelect -edgeBorder true;
string $borderEdges[] = `ls -sl`;
$internal = `polyListComponentConversion -ff -te -internal $sel`;
select $internal;
select -d $borderEdges;

Hope it helps

 

Mike

0 Likes