-- add Materials from Selected objects to MEditor slots --------------------------------------------------------------- -- [V.1] - starting from 1st MEditor Slot ( local sel = selection as array if sel.count == 0 then messageBox "Nothing selected!" title:"Selection" else ( mtl = #() for i in sel where i.material != undefined do appendIfUnique mtl i.material if mtl.count > 0 do -- if there materials ( if mtl.count > 24 do -- if they are > 24 mtl.count = 24 -- keep 24 of them for m in 1 to mtl.count do meditMaterials[m] = mtl[m] ) ) ) -- [V.2] - starting from current Active MEditor Slot ( local sel = selection as array if sel.count == 0 then messageBox "Nothing selected!" title:"Selection" else ( mtl = #() for i in sel where i.material != undefined do appendIfUnique mtl i.material ams = activeMeditSlot if mtl.count > 0 do ( freeSlots = 25 - ams if mtl.count > freeSlots do mtl.count = freeSlots for m in 0 to mtl.count-1 do meditMaterials[ams+m] = mtl[1+m] ) ) )