[Closed] How to Convert vertex to poly in maxscript?
I have a problem with converting vertex to poly in editable poly.
Now i use this
<integer>[b][b]ConvertSelection[/b][/b] <enum>fromLevel <enum>toLevel [b][b]requireAll[/b][/b]:<bool>
but i’d like something different… E.G.: I have selected all vertex around the one polygon and i’d like select only that polygon in center. Is it possible?
If i use the ConvertSelection + Shrink then on the outskirt is wrong.
(Sorry for my english)
thx for any idea
This is what requireAll:true is for. Only polygons that have all their vertices selected will be selected.
Once more question. Is it possible this in editable mesh? Because the editable poly is toooo lazy
You could easily script it yourself.
Use the meshop.getFacesUsingVert method to collect the faces used by each vertex and then find the intersection of the 3 arrays – that face is the one that is using all 3 vertices.
The other way would be to call meshop.getFacesUsingVert once by passing all selected vertices, then get the result and check each face whether all its vertices are on the original list. If at least one is not, remove that face from the list…
Here is a sample implementation, assuming that the object is collapsed to Editable Mesh base object:
fn convertVertToFaceSelection theMesh =
(
theVerts = getVertSelection theMesh
theFaces = (meshop.getFacesUsingVert theMesh theVerts) as array
for f = theFaces.count to 1 by -1 do
(
theFace = getFace theMesh theFaces[f]
removeFace = false
if not theVerts[theFace.x] do removeFace = true
if not theVerts[theFace.y] do removeFace = true
if not theVerts[theFace.z] do removeFace = true
if removeFace do deleteItem theFaces f
)
setFaceSelection theMesh theFaces
)
convertVertToFaceSelection $
max modify mode
subObjectLevel = 3