An object can't have multiple materials so i assume you talk about multimaterial ? If so, you need to parse it, like an array. This covers the case, and works with multiple objects selection. I've added some security checks. ( sel = selection as array for obj in sel do ( myMat = obj.mat if myMat != undefined then ( if…
Opty = meditMaterials[Mname].opacity Do you just want to save the material opacity of your selected object ? You could just do : <code>matOpacity = myMat.opacitymyMat = selection[1].mat<br>matName = myMat.name<br> No need to deal with the material editor.