Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Vertex Killer v1.0
- -- By Mauricio B. G.
- -- (10/03)
- --
- -- This tool will remove any SELECTED vertices that are shared by ONLY and EXACTLY 2 edges.
- -- Use: couldn't be more easy. Select a poly object, select some vertices and run the script.
- -- Installation: copy to max/ui/macrosript and put anywhere you want in max with the customize UI option.
- --
- macroScript Vertex_Killer category:"MBG Tools" tooltip:"Vertex Killer 1.0 by MBG"
- (
- counter = 0
- if classof $ == Editable_poly then
- (
- if subobjectlevel == 1 then
- ( -- start the action
- undo on(
- sel = polyop.getVertSelection $ -- get the selected vertices
- selcount = sel as array
- for x = 1 to selcount.count do (
- vi = selcount[x]
- edg = polyOp.getEdgesUsingVert $ vi -- get the edges that use the vertice
- quantos = edg as array
- if quantos.count == 2 then (
- polyop.setvertselection $ vi
- counter = counter + 1
- $.EditablePoly.Remove ()
- for y = 1 to selcount.count do (
- -- we removed a vertice, so we need this
- selcount[y] = selcount[y] - 1
- )
- ) -- end if
- ) -- end for
- ) -- end undo
- str = "Done. Vertices removed: " + counter as string
- messagebox str title:"MBG Vertex Killer"
- )
- else messagebox "You should select vertices first." title: "MBG Vertex Killer"
- )
- else messagebox "The object selected isn't a editable poly or nothing is selected." title: "MBG Vertex Killer"
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement