is there an option to create a script which turns EACH of the SELECTED groups to one single object respectively (collapses the objects in each group to one object), and preserve materials (collected to multisubobject).
Not a lot of error checking here, but it seems to work.
--SCRIPT THAT COMBINES BY GROUP
(
fn combineSelection newName =
(
local Objs,firstObj
--GET THE SELECTION AS ARRAY
Objs = getcurrentSelection()
--DELETE THE REFERENCE TO THE FIRST ITEM OF THE SELECTED ARRAY
firstObj = convertToPoly(Objs[1])
firstObj.name = newName
deleteItem Objs 1
--ATTACH ALL OTHER ITEMS TO THE FIRST NODE.
for obj in objs where canConvertTo obj Editable_Poly do firstObj.attach obj firstObj
)
--FIND THE GROUPS
groups = #()
for obj in objects do
(
if isGroupHead obj do append groups obj
)
--EXPLODE AND ATTACH GROUPS
for g in groups do
(
gName = g.name
select g
explodeGroup g
combineSelection gName
)
)
Replies