PDA

View Full Version : remove edges script that selects left-over vertices :)


erik_j
03-19-2006, 09:59 AM
wow my first script. it's very simple.
anyway it works like the remove command in edges mode but when the edges are removed the vertices that were left behind on single lines will be selected (except for corner verts).

EDIT: I just noticed it gets rather slow on larger meshes, hehe well well, so wouldn't recommend it.

>> zip (http://nim.pansarvagn.net/nim_removeedges++_v0.2.zip) <<

scorpion007
03-20-2006, 01:30 AM
Hehe, this has been done about 100 times before :P By many people including myself.
Orionflame, polyboost both have this tool too. And many other free modeling scripts come with something like this.

erik_j
03-20-2006, 01:37 AM
ahah, bummer, was just about to check out polyboost, would've saved me the time. thanks for pointing out :-)

JHaywood
03-20-2006, 05:11 PM
Yep, I did this to. :) But they've made it even easier for Max 8, just use the command, <Edit_Poly>.remveEdgeCtrlKey, to take advantage of the new functionality of the Remove button. What's weird though is that it's only available for Edit Poly, not Editable Poly.

erik_j
03-21-2006, 03:05 PM
ah I found a free script that does the same work on scriptspot called Vertex Killer.
I guess it's alot simpler this way around. but if someone has written a fast script that autoselects the left over verts when removing edges with the script, please post or send it to me by email so I can improve mine :)

JHaywood
03-23-2006, 11:31 PM
I haven't touched this in a while, but this is the script I use...

macroScript PMT_removeEdgesAndVerts
category:"HaywoodTools"
(
fn getVertsUsingEdge_editPolyMod theMod theEdges = (
vertArr = #()
for i in theEdges do (
for ii = 1 to 2 do (
theVert = theMod.getEdgeVertex i ii
if findItem vertArr theVert == 0 then append vertArr theVert
)
)
return vertArr
)

obj = modPanel.getCurrentObject()
-- edit poly collapsed object
if classOf obj == editable_poly then (
if subObjectLevel == 1 do obj.EditablePoly.Remove ()
if subObjectLevel == 2 do (
with redraw off (
getEdges = polyop.getEdgeSelection obj
getVerts = polyop.getVertsUsingEdge obj getEdges
polyop.setVertSelection obj getVerts
obj.EditablePoly.Remove selLevel:#Edge
getVerts = #()
for v in (polyop.getVertSelection obj) do (
if ((polyop.getEdgesUsingVert obj v).numberSet) == 2 do polyop.setVertSelection obj (append getVerts v)
)
polyop.setVertSelection obj getVerts
obj.EditablePoly.Remove selLevel:#Vertex
) -- end redraw off
) -- end sol 2
) -- end classOf editable_poly
-- edit poly modifier
if classOf obj == Edit_Poly then (
if subObjectLevel == 1 then (
obj.buttonOp #removeVertex
)
if subObjectLevel == 2 then (
with redraw off (
getEdges = obj.getSelection 2
getVerts = getVertsUsingEdge_editPolyMod obj getEdges
obj.setSelection 1 (getVerts as bitarray)
obj.buttonOp #removeEdge
getVerts = #()
for v in (obj.getSelection 1) do (
if ((obj.getVertexEdgeCount v) == 2) then obj.setSelection 1 ((append getVerts v) as bitarray)
)
obj.setSelection 1 (getVerts as bitarray)
obj.buttonOp #removeVertex
) -- end redraw off
) -- end sol 2
) -- end classOf Edit_Poly
)

shibumenon
03-24-2006, 02:58 AM
mine does something similar:
http://www.aaachooo.com/files/maxscripts/MeshCleaner.ms

CGTalk Moderation
03-24-2006, 02:58 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.