[Closed] Similar objects to new layers
Hi,
I would need some help to create a script that can automate placing the similar objects in the scene into separate layers.
I believe this is the way the script should work. I am new to Maxscript, but I tried to write something but it doesnt work. Could you please help?
Thanks
–select all objects in the scene and put them in an array
–select obj[1] in array
–select similar objects like obj[1]
–move selected objects to new layer
–delete these items from the array
–loop through remaining items in the array
theArr = objects as array –select all objects in the scene and put them in an array
listed = sort (for i in theArr collect i.name) – sort my objects
print listed
for j in theArr do
(
select j
actionMan.executeAction 0 “40099” – Selection: Select Similar
layer = LayerManager.newLayer() – create new layer
layer.setname (“Layer” + i) – set layer’s name incremental
for n in (selection as array) do layer.addnode n – add nodes to layer from selection
)