Notifications
Clear all

[Closed] Select element by poly count

Hi guys how are you all?

I’ve been having a play with this myself and to be honest its a bit over my head as my maxscripting knowledge is kinda limited.

Anyway what I’m trying to do is separate leaves from vines – and basically I want to be able to select all elements that have a poly count larger then 3, does anyone know how I’d go about doing this?

2 Replies

run this script:

(
local newSel=#()
for obj in geometry where (isProperty obj "numFaces") do (
	if obj.numFaces>3 do (append newsel obj)
	)
select newSel
)

I hope this helps

sorry I just realize you said “element”…

(
max modify mode
for obj in selection where (classof obj==Editable_Poly) do (
	local theFaces= #{1..obj.numFaces}
	local newSelection= #{}
	while theFaces.numberset>0 do (
		local currentElem= polyOp.getElementsUsingFace obj #{(theFaces as array)[1]}
		if currentElem.numberset>3 do newSelection+=currentElem
		theFaces-= currentElem
		)
	polyOp.setFaceSelection obj newSelection
	)--for
)

It is for Editable_Polys