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.
By
Comments (16)
Comment policy
thanks
Great and useful script, thanks Graph.
God bless you.
select what you want to combine and run the script ;)
Nice one Graph :)
An "max group ungroup" at the end is also nice ;)
Break face material id
Hi dear raphael,
your code works like a charm but when I apply it to my objects with diffrent material id,material id break and all of the material are in 1.
tested this one with 2k objects and max didnt crash, just froze a bit:
have phun
hello and thanks for interest;
i copy pasted your script , and ran it but nothing happened?
as i stated before, i have no scripting experience
Hey, this is partially working great!
Some problems though...
1)It does not give the group's name to the attached object
2) if i run it without a selection, it gives an error and stops,
the real problem is it stops after the command :" disableSceneRedraw()" so the viewpot stops untill i restart max,
can it just warn instead?
i am still looking for a one-click solution :)
this example script of yours is "no-go" for non-scripters sadly.
atm i explode the group , select one and use attach list to sort by face count , attach them gradually...
Ok, you need to sort them by face count and then attach them gradually, and I'll try to help you, but is there a script for non-scripters?... So try this for illustration:
With this in mind I hope you catch my idea that is to (1) rename the objects (using their poly-count as names), (2) collect their names to array, (3) sort array, (4) attach. Lets try then, - after explode the group, select all its objects and run the script:
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 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:
you need to select your objects first and collect them to the array. If they are grouped, just ungroup before.
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 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:
...and repeat steps 1-3 for all groups.
I hope this help allObjs =
I hope this help
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..