fn GetObjsFromActiveMat =
(
--local Mtls = #() --所选物体的材质名集合
local resultObjs=#()
local noMatObj = #()
mat =meditmaterials[activeMeditSlot]
refs_objs =refs.dependents mat --正常返回的是一个包含材质与物体的数组,但有些材质不知道什么原因,没包含到物体
resultObjs = for obj in refs_objs where superclassof obj == GeometryClass collect obj
--如果这个objs =refs.dependents mat没有GeometryClass类的物体,则是直接将选择的物体返回给resultObjs
if resultObjs.count==0 then resultObjs = Objs
resultOjbs = if resultObjs != undefined then ( join resultObjs noMatObj)
return resultOjbs
)
3dsmax script 使用脚本获取激活材质球所关连的物体
最新推荐文章于 2023-05-02 18:09:45 发布