美文网首页
3dmax同名不同格式贴图指认

3dmax同名不同格式贴图指认

作者: Rayson | 来源:发表于2023-04-05 16:57 被阅读0次

    先指认路径正确路径
    1.选择所有物体

    image.png

    可以批量改成PNG
    2.运行脚本

        global all_ = #()
                    global base_ = #()
                    for i in selection do
                    (
                            if classof i.material == Standardmaterial do
                            (
                                    if i.material.diffusemap != undefined and classof i.material.diffusemap == Bitmaptexture do (append all_ i.material)
                            )
                            if classof i.material  == Multimaterial do
                            (
                                    for j = 1 to i.material.count do
                                    (
                                            if i.material.material[j] != undefined do
                                            (
                                                    if i.material.material[j].diffusemap != undefined and classof i.material.material[j].diffusemap == Bitmaptexture do (append all_ i.material.material[j])
                                            )
                                    )
                            )
                            if classof i.material == Shell_Material do
                            (
                                    if classof i.material.originalMaterial == Standardmaterial do
                                    (
                                            if i.material.originalMaterial.diffusemap != undefined and classof i.material.originalMaterial.diffusemap == Bitmaptexture do (append all_ i.material.originalMaterial)
                                    )
                                    if classof i.material.originalMaterial  == Multimaterial do
                                    (
                                            for k = 1 to i.material.originalMaterial.count do
                                            (
                                                    if i.material.originalMaterial.material[k] != undefined do
                                                    (
                                                            if i.material.originalMaterial.material[k].diffusemap != undefined and classof i.material.originalMaterial.material[k].diffusemap == Bitmaptexture do (append all_ i.material.originalMaterial.material[k])
                                                    )
                                            )
                                    )
                                    if classof i.material.bakedMaterial == Standardmaterial do (append all_ i.material.bakedMaterial)
                            )
                    )---以上收集所有standardmaterial
                    for i in all_ do
                    (--all
                            pic_ = i.diffusemap.filename
                            path_ = getFilenamePath pic_
                            name_ = getFilenameFile pic_
    
                            newpic_ = path_ + name_ + ".png"
                            i.diffusemap.filename = newpic_
                            if i.opacityMap != undefined do
                            (
                                    i.opacityMap = copy i.diffusemap
                                    i.opacityMap.alphasource = 0
                                    i.opacityMap.monoOutput = 1
                            )
                            i.adTextureLock = off
                            i.ambientMap = undefined
                            i.adTextureLock = on
                            i.specularMap = undefined
                            i.specularLevelMap = undefined
                            i.glossinessMap = undefined
                            i.selfillumMap = undefined
                            i.filterMap = undefined
                            i.bumpMap = undefined
                            i.reflectionMap = undefined
                            i.refractionMap = undefined
                            i.displacementMap = undefined
                    )--all
    

    相关文章

      网友评论

          本文标题:3dmax同名不同格式贴图指认

          本文链接:https://www.haomeiwen.com/subject/xhtyddtx.html