代号小一

看不到子标题【表情】

导航

关于层的操作

很少用到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则删除所有层
)

关于图层操作的帮助文档:

http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-78B79975-7BA5-4A03-8FEF-27E78D14B575.htm,topicNumber=d30e259872

http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-79537E16-FE25-4567-BEA6-06F39E0A5C1F.htm,topicNumber=d30e209165

posted on 2015-05-15 10:02  代号小一  阅读(321)  评论(0编辑  收藏  举报