...as the selected object ?
Announcement
Collapse
No announcement yet.
Is there a way (script) to select objects with similar amount of vertices...
Collapse
X
-
Code:select (for o in objects where (getPolygonCount o)[2] == (getPolygonCount $)[2] collect o)
www.hofer-krol.de
Visualization | Animation | Compositing
-
Should be pretty self explainatory. Change "thresholdPercent" to be how similar you need the objects to be, 0 = no deviation in vert count, 0.03 = 3% deviation in vert count.
Code:( local thresholdPercent = 0.01 -- Anything similar within 1% of the same vertices count will be selected local obj = GetCurrentSelection() if obj.count != 1 then ( MessageBox "Please select one object." return false ) obj = obj[1] local numverts = (GetPolygonCount obj)[2] local lowNum, highNum local selectArray = #() format "numverts: %\n" numverts max create mode for o in objects do ( lowNum = ceil (numVerts - (numverts * thresholdPercent)) highNum = floor (numVerts + (numverts * thresholdPercent)) if ((GetPolygonCount o)[2] >= lowNum) and ((GetPolygonCount o)[2] <= highNum) then append selectArray o ) select selectArray )
Colin Senner
Comment
Comment