[Closed] Groups to mesh
i would like to convert a group to one editable poly model. inside the group i have many objects that have editmesh,edit poly ,splines (with a modifier creating a model). a lot of times i have groups inside groups inside groups.
would it be possible to have a script where you select the main group and it would collapse all modifiers and than attach all objects together into one object?
You can do the with the “Collapse” tool in the utility tab AFAIK
It’s hidden under “More… ” by default i think
the Collapse tool converts them into one object but its not using the ‘‘attach options’’ for materials
http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-Help/index.html?url=files/GUID-5D150A95-7F9D-498D-B668-7BEFA3D5E1BA.htm,topicNumber=d30e134570
for example. if we have 4 objects with different multi/sub materials it doesnt convert them together and changes the material ID’s.
fn attachGroupMembers group = if isgrouphead group do
(
setGroupOpen group off
nodes = for node in (join #() group) where canconvertto node editable_poly collect node
converttopoly nodes
for k = nodes.count to 2 by -1 do polyop.attach nodes[1] nodes[k] -- here can be fast attach method
explodeGroup group
nodes[1]
)
it has to work for open, closed, nested groups, and everything else (all geometry kind, make multi material, etc.)
my function works exactly opposite: it doesn’t select group (because i don’t do it in purpose) and attaches nodes inside specified group.
there are three possible cases why it might not work for you (in most probable order):
you use my function wrong
you try to attach not attachable (helpers, cameras, lights, etc.)
i’ve missed something
here is the sample that works well:
fn attachGroupMembers group = if isgrouphead group do
(
setGroupOpen group off
nodes = for node in (join #() group) where canconvertto node editable_poly collect node
converttopoly nodes
for k = nodes.count to 2 by -1 do polyop.attach nodes[1] nodes[k] -- here can be fast attach method
explodeGroup group
nodes[1]
)
delete objects
bb = for k=0 to 3 collect box pos:[k*40,0,0]
cc = for k=0 to 3 collect cylinder pos:[k*40,40,0]
ss = for k=0 to 3 collect sphere pos:[k*40,80,0]
a = group bb
b = group cc
c = group (join ss #(a,b))
/*
--- RUN IT ---
attachGroupMembers c
*/
if anything doesn’t work please post a sample.
this is what i think would be practical for 3ds max users. if we could attach objects inside the group by only selecting the group.
if you select the group it doesnt select objects inside the group. 3dsmax has Collapse which works good. no matter how many groups you have inside the group. if you select the main group and use Collapse it will create one object. but it doesnt create new material ID’s to create one multi/sub material for the new single object.