Convert Group to mesh
summary:
lets say; you have a tree object with all leaves as separate meshes , when attach them into one big heavy mesh at once, max crashes.
but i can attach them one by one which takes quite alot of time...
the script will divide the group of high level geometery into 3-10 meshes.
how long does it take to make a script like this one below?is it beginner level?
get selected group's name
explode group
rename the meshes inside , sequentially according to group name like: "groupname_01-02-03"
count polygon of each mesh.
attach small(number of polygon) meshes to "groupname_01" until
mesh reaches 1000 polygons.then
attach medium meshes untill mesh reaches 1000 polygons and name it:"groupname_M_01,02..."
rename large meshes that has more than 1000 polygons as "groupname_L_01,02,03.."
attach all created meshes in to one big mesh , named"groupname"
looking foward to any replies.
thanks.
Comments
Hi Anubis ; i copied and
Hi Anubis ;
i copied and pasted your script , i grouped 27 objects , selected the group01 and ran the script:
-unable to convert:undefined to type:
and highlights this string at 7:
"if (getPolygonCount allObjs[i])[1] <= 500 do ("
http://yfrog.com/j3test1grp2meshj (error screen)
Ok, I suspect so you have not
Ok, I suspect so you have not MaxScript knowledge. This is a snippet code that you need to modify for your needs. The error itself come from the "allObjs" that Max see as undefined. In this 1st step:
allObjs = selection as array -- collect all to array
you need to select your objects first and collect them to the array. If they are grouped, just ungroup before.my recent MAXScripts RSS (archive here)
yes indeed ;i am at scripting
yes indeed ;i am at scripting 0 , if "collect to array "means that i really have to create an array some how :) will try...
i hope just mean to explod the group+select the objects and run the script... which is my cup of tea.
Well, when my code will not
Well, when my code will not help alot :) My idea was to select all objects what need to be attached and organize them into arrays (by objects poly-count). But as you group as you dont need this organazing step. So, shortly, all what you need is to know the name of the object to wich you will attach. Lets to sey it is named "main"; [1] ungroup 1st group; [2] select ungrouped objects and [3] run this code line:
for i in selection do attach $main i
...and repeat steps 1-3 for all groups.
my recent MAXScripts RSS (archive here)
I hope this help allObjs =
I hope this help
my recent MAXScripts RSS (archive here)
for example it took 20
for example it took 20 minutes to attach a 500k faced furniture model into one mesh, i had to do it in 5 passes...
if i did it on one go! my system would hang , its 2 gbs xp64..