zbw_shadingTransfer.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:zTools 作者: zethwillie 项目源码 文件源码
def copyShader(src = "", tgts = [], *args):
    """
    gets the shader from the src and assigns it to the tgt objs

    Args:
        src (string): the object we're getting the shader FROM
        tgts (list[strings]): the objects we're setting the shaders TO
    """
    confirm = confirmDialog("Should I copy shaders?")
    if confirm == "Yes":
        for tgt in tgts:
            shp = cmds.listRelatives(src, s=True)[0]
            sg = cmds.listConnections(shp, t="shadingEngine")[0]
            tshp = cmds.listRelatives(tgt, s=True)[0]
            cmds.sets(tshp, e=True, forceElement=sg)
    else:
        print "Copy shader assignment cancelled"
        return()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号