fn check_mat_ref mat =
(
refs_objs = refs.dependents mat
have_obj = False
if refs_objs != undefined do
(
resultobjs = for obj in refs_objs where superclassof obj == GeometryClass or SuperClassof obj == Shape collect obj
if resultobjs != undefined and resultobjs.count > 0 do have_obj = True
)
have_obj
)
#收集场景中所有有被使用的材质球
fn get_scene_used_mat =(mats = for mat in SceneMaterials where check_mat_ref mat collect mat;mats)
maxscript 检查材质球是否有物体使用
最新推荐文章于 2024-05-31 21:57:03 发布
该代码段定义了两个函数,fncheck_mat_refmat用于检查场景中是否有使用到的材质球,通过遍历refs_objects并筛选GeometryClass或Shapeclass的子类对象来实现。fnget_scene_used_mat则收集场景中所有被使用的材质,通过调用fncheck_mat_refmat并过滤出formatinSceneMaterials中被引用的材质。

888

被折叠的 条评论
为什么被折叠?



