-- this function selects polygons assigned to mat and assigns a matid of count-- mat is the mat to select the polys by and count is the mat id to assign to the polysfunction assignMatId mat count = ( -- set the mat into meditMaterials in the second slot meditMaterials[2] = mat -- set the second slot to the active…
You need to collect obj, and not o :)objarr = for obj in objects where obj.material == meditMaterials[medit.getActiveMtlSlot()] collect obj If you already give the mat to the function tho, i'm not sure why you put it in the medit. If you just want to get objects that have the currently selected mat in the medit, you just…