很少用到max里的 层 ,虽然对大场景的管理很有帮助,但可能是我没做过什么大场景吧哈哈~
有时因为图层问题导致自动渲染程序渲染不出物体...
我的办法就是快刀斩乱麻,所有物体合并到同一层,然后删除其他空层,并将图层设置成可渲染.
fn clear_layer = ( all_obj = #() layer_names = #() for i = 0 to layerManager.count-1 do ( ilayer = layerManager.getLayer i ilayer.nodes &all_nodes join all_obj all_nodes append layer_names (ilayer.name as string) )--收集所有组内的节点到all_obj,组名称到layer_names layer_0 = layerManager.getLayer 0 for o in all_obj do (layer_0.addNode o)--将所有节点移动到0层 layer_0.current = true --激活图层 layer_0.ishidden = false --隐藏图层 layer_0.isfrozen = false --冻结图层 if layer_names.count > 1 do ( for d in layer_names do LayerManager.deleteLayerByName d )--如果层数大于1则删除所有层 )
关于图层操作的帮助文档:
时间: 2024-11-05 22:41:14