I wrote this script today for myself and thought it might come in handy for some of you doing high poly models. It selects all non four sided polys in an EPoly object in Max. This way, you can see where you need to do some cleanup if you want an all quad mesh for bringing in to ZBrush. You can use it in an editable poly modifier also, but I'd suggest using it on a collapsed editable poly object because it runs much faster that way.
<font class="small">Code:</font><hr /><pre>(
max modify mode
local obj = selection[1]
local objMod = modPanel.getCurrentObject()
if classOf objMod == editable_poly then (
local faceSelArr = for i = 1 to objMod.getNumFaces() collect(
if (polyop.getVertsUsingFace objMod i).numberSet != 4 then i else continue
)
polyop.setFaceSelection objMod faceSelArr
)
else if classOf objMod == edit_poly then (
local faceSelArr = for i = 1 to objMod.getNumFaces() collect(
if (
objMod.setSelection
#face #{i}
objMod.convertSelection
#face #vertex
) != 4 then i else continue
)
objMod.setSelection
#face (faceSelArr as bitarray)
)
else messagebox "Make sure an Editable Poly object or Edit Poly modifier is selected."
update obj
subObjectLevel = 4
)</pre><hr />
Replies
<font class="small">Code:</font><hr /><pre>macroscript SelectNonQuadPolys category:"HowTo"
(
on isEnabled return
(
selection.count == 1 and classOf selection[1].baseobject == Editable_Poly
)
on execute do
(
local face_selection = #{}
local base_obj = $.baseobject
local num_faces = polyop.getNumFaces base_obj
for f = 1 to num_faces do
(
local num_face_verts = polyop.getFaceDeg base_obj f
if num_face_verts != 4 do face_selection[f] = true
)--end f loop
polyop.setFaceSelection base_obj face_selection
max modify mode
modPanel.setCurrentObject base_obj
subobjectlevel = 4
)--end on execute
)--end script </pre><hr />
I didn't know that was there. Guess I should check out the sample scripts more often. One thing mine does do is work within an Edit Poly modifier, whereas that one only works with the base Editable Poly object. But using mine on a high poly model in an Edit Poly modifier is very slow, which is probably why that option wasn't added in the How To version.
hehe, cool script, thanks for sharing Polyboost does a very good job there too.
Cheers