自动检查顶点色、2U、ID、坐标轴的测试

来源:互联网 发布:html实时数据页面设计 编辑:程序博客网 时间:2024/05/29 16:34
自动检查部分(顶点色、2U、ID、坐标轴)的测试
global CPVobj = #()global UV2obj = #()global CPVobj1 = #()global UV2obj1 = #()global PTobj = #()global IDobj = #()global PTobj1 = #()global IDobj1 = #()--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\fn checkpoly =     --**定义检查是否为poly物体的函数,对skin物体还是有bug**(    sel = getCurrentSelection()    ------------------------------------    for a=1 to sel.count do    (    if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject != editable_poly then      --判断是否有加了skin修改器,原始层次是否为poly        (            pasteS = copy sel[a].modifiers[#skin]                           --定义一个变量,复制skin修改器                  skinOps.SaveEnvelope sel[a].modifiers[#Skin]                    --保存skin文件            ConvertToPoly sel[a]                                            --转为poly            --粘贴上之前复制的skin修改器                  skinOps.LoadEnvelope sel[a].modifiers[#Skin]                   --加载skin文件         )    )        --------------------------    for a=1 to sel.count do    (        if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject == editable_poly then print sel[a].name    )        ------------------------------    for a=1 to sel.count do    (        if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject == editable_poly then print sel[a].name    )        --------------------------------    for a=1 to sel.count do    (        if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject != editable_poly then ConvertToPoly sel[a]    ))-----------------------------------------------------fn getCPVobj =   --定义函数,收集有顶点色的物体    (    sel = getCurrentSelection()    for a=1 to sel.count do    (        if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject != editable_poly then            (                --if getnumCPVverts sel[a] != 0 then append CPVobj sel[a].name                    --**getnumVPCverts只能针对mesh类操作**                --if getnumCPVverts sel[a] != 0 then append CPVobj1 sel[a]                if sel[a].GetMapChannelActive 0 == true then append CPVobj sel[a].name               --**$.GetMapChannelActive 0 == true 判断通道信息里的0通道是否为真,真表示存在顶点色**                if sel[a].GetMapChannelActive 0 == true then append CPVobj1 sel[a]                  print CPVobj            )    )    for a=1 to sel.count do    (        if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject == editable_poly then            (                if sel[a].GetMapChannelActive 0 == true then append CPVobj sel[a].name                if sel[a].GetMapChannelActive 0 == true then append CPVobj1 sel[a]                print CPVobj            )    )    for a=1 to sel.count do        (        if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject == editable_poly then            (                if sel[a].GetMapChannelActive 0 == true then append CPVobj sel[a].name                if sel[a].GetMapChannelActive 0 == true then append CPVobj1 sel[a]                print CPVobj            )        )    for a=1 to sel.count do        (        if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject != editable_poly then            (                if sel[a].GetMapChannelActive 0 == true then append CPVobj sel[a].name                if sel[a].GetMapChannelActive 0 == true then append CPVobj1 sel[a]                print CPVobj            )        )    )    --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\    fn getUV2obj =     --定义函数,收集有2U的物体    (        sel = getCurrentSelection()        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject != editable_poly then                (                if meshop.GetMapSupport sel[a] 2 == true then append UV2obj sel[a].name                --**GetMapSupport可以有meshop和polyop两种,分别针对mesh物体和poly物体**                if meshop.GetMapSupport sel[a] 2 == true then append UV2obj1 sel[a]                print UV2obj                )        )        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject == editable_poly then            (                if polyop.GetMapSupport sel[a] 2 == true then append UV2obj sel[a].name                if polyop.GetMapSupport sel[a] 2 == true then append UV2obj1 sel[a]                print UV2obj            )        )        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject != editable_poly then                (                    if meshop.GetMapSupport sel[a] 2 == true then append UV2obj sel[a].name                    if meshop.GetMapSupport sel[a] 2 == true then append UV2obj1 sel[a]                    print UV2obj                )        )        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject == editable_poly then                (                    if polyop.GetMapSupport sel[a] 2 == true then append UV2obj sel[a].name                    if polyop.GetMapSupport sel[a] 2 == true then append UV2obj1 sel[a]                    print UV2obj                )        )    )    --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\fn getPTobj =   --定义函数,收集物体坐标为归零的物体    (        sel = getCurrentSelection()        for a=1 to sel.count do        (            if sel[a].pivot != [0,0,0] then append PTobj sel[a].name            if sel[a].pivot != [0,0,0] then append PTobj1 sel[a]            print PTobj        )    )    --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\fn getIDobj =   --定义函数,收集ID不为一的物体    (    sel = getCurrentSelection()        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject != editable_poly then            (            Faceid = getFaceMatID sel[a] 1                 --**mesh物体直接用 getFaceMatID $ 1;poly物体用polyop.getFaceMatID $ 1**            if Faceid != 1 then append IDobj sel[a].name            if Faceid != 1 then append IDobj1 sel[a]            print IDobj            )        )        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject == editable_poly then            (            Faceid = polyop.getFaceMatID sel[a] 1            if Faceid != 1 then append IDobj sel[a].name            if Faceid != 1 then append IDobj1 sel[a]            print IDobj            )        )        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject == editable_poly then            (            Faceid = polyop.getFaceMatID sel[a] 1            if Faceid != 1 then append IDobj sel[a].name            if Faceid != 1 then append IDobj1 sel[a]            print IDobj            )        )        for a=1 to sel.count do        (            if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject != editable_poly then            (            Faceid = getFaceMatID sel[a] 1            if Faceid != 1 then append IDobj sel[a].name            if Faceid != 1 then append IDobj1 sel[a]            print IDobj            )        )    )fn checkSel =     --定义一个函数,检查是否选择了物体(    sel = getCurrentSelection()    sel1 = #()    if sel.count == 0 then messagebox "请先选择要操作的物体!"        for i in sel do        (        if classof i == editable_poly do join sel1 i        )        return sel1    )--=======================================================--checkpoly()getCPVobj()getUV2obj()getPTobj()getIDobj()    print CPVobj        print UV2obj    print CPVobj1        print UV2obj1    print PTobj    print IDobj    print PTobj1    print IDobj1