Collecting ngon objects

Collecting ngon objects

rartidiello
Enthusiast Enthusiast
1,544 Views
2 Replies
Message 1 of 3

Collecting ngon objects

rartidiello
Enthusiast
Enthusiast

Hi,

Can anyone help me on making a script for collecting the objects having ngons from a given selection?

Thanks

 
0 Likes
Accepted solutions (1)
1,545 Views
2 Replies
Replies (2)
Message 2 of 3

miauuuu
Collaborator
Collaborator
Accepted solution

This will select all objects which have at least one polygon with more than 4 sides.

 

(
	poGetNumFaces = polyop.getNumFaces
	selObjsArr = selection as array
	nGonsObjsArr = #()
	for o in selObjsArr where classOf o == Editable_Poly do
	(
		oNumFaces = poGetNumFaces o
		stopLoop = false
		for f = 1 to oNumFaces while stopLoop == false where (o.getFaceDegree f) > 4 do
		(
			append nGonsObjsArr o
			stopLoop = true
		)
	)
	if nGonsObjsArr.count != 0 do
	(
		select nGonsObjsArr
	)
)
https://miauu-maxscript.com/
Message 3 of 3

rartidiello
Enthusiast
Enthusiast

Thanks a lot @miauuuu, I'm a huge fan of your scripts and this as always works like a charm.