(Help needed) SelectionMtls to MultiSubMat - ID count error
Hey there,
as I was looking for a material to MultiSubMat collector script I found this one below. It works like I hoped and puts the materials of the selected objs in the subslots but only with obj counts below 11.
After the 11 material the multisub.matrialIDList doesn't count further above 12 and I get the dublicated material ID error.
Was trying some IDList[] commands but my script knowledge is pretty basic. So i hope for help. I think its an command bug with the mmtl itself and its standard 10 material slots.
( if selection.count != 0 do ( mmtl = multimaterial name:"SelectionMtls" mmtl.materialList = for i = 1 to selection.count where selection[i].material != undefined collect ( addModifier selection[i] (Materialmodifier materialID:i) selection[i].material ) --add new material to material editor (first slot) selection.material = meditMaterials[1]= mmtl ) )
Attachment | Size |
---|---|
script.jpg | 71.66 KB |
Comments
...
Try this fn
bga
Wow, thanks. Great. Was in
Wow, thanks. Great. Was in vacation so sorry for the late response. Works but in one particular scene object it crashes max, because it adds 800 of material dublicates for each obj that has the same material.
Is it possible to write an condition that it skips adding the same materials over and over and accordingly sets the material IDs correct?
In my particular scene I got a multisub with 800 submaterials which consist 9 materials the rest are dublicates. Clean Multisub crashes max.