Script to Auto-Organize Objects into Layers by Poly Count.
Hello,
So... I'm trying to figure out the best way to organize objects in a scene into layers by their poly counts and then name those layers according to their poly counts.
So all objects that have 10 polygons would go into a layer called "PolyCount_010", objects that have 592 polygons would go into a layer called "PolyCount_592", etc.
Does anyone know of a script that can do this? Or at least maybe the best way to go about it?
Any help would be GREATLY appreciated!
Comments
...
Is this fn that you looking for?
bga
:o .... You're a Script-God
:o .... You're a Script-God among men. This is _exactly_ what I was looking for. A thousand thank you's, barigazy. This is amazing.
...
;)
You're welcome
Enjoy
bga
Here are some useful bits of script
Here are some useful bits of script that I have found so far (that other users have put together) to select objects with certain vert counts:
By User: Anubis
To select objects with more then 32000 vertices:
select (for o in geometry where \
(getPolygonCount o)[2] >= 32000 collect o)
By User: miauu
To select objects with more then 32000 vertices:
select (for o in geometry where ( o.numverts >= 32000) collect o)
By jkwiatkowski
To select objects with poly count lower than...:
fn selectByPolygonCount arrayOfNodes numFaceFrom numFaceTo = (
--clear selection
clearSelection()
--loop through array of nodes
for obj in arrayOfNodes do
(
tmpArr = getPolygonCount obj
numFaces = tmpArr[1]
if numFaces >= numFaceFrom and numFaces <= numFaceTo do selectMore obj
)
)