-- 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 polys
function assignMatId mat count = (
-- set the mat into meditMaterials in the second slot
meditMaterials[2] = mat
-- set the second slot to the active one
medit.SetActiveMtlSlot 2 true
-- select the polys assigned to mat
objarr = for obj in objects where obj.material == meditMaterials[medit.getActiveMtlSlot()] collect o
--assign selected polys a matid of count
--.. still writing this code
)
这是我正在尝试编写的功能。但是,我目前停留在选择分配给垫子的多边形上。所以我的问题是:
我将如何给选定的材料(meditMaterials 中的 activeSlot)选择所有具有该材料的多边形。材质可能分配给多个对象,因此它也需要选择到其他可编辑的多边形对象中。
关于从哪里开始的任何想法?