zbw_curveExtrude.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def clearShaderConnections(ts="", geo="", *args):
    myShape = cmds.listRelatives(geo, s=True)[0]
    tsList = cmds.listAttr(ts, m=True, st=["*input*"])
    if tsList:
        # delete empty entries? ? 
        # for tsInput in tsList:
        #   shpList = cmds.connectionInfo("{0}.{1}.inShape".format(ts, tsInput), sfd=True)
        #   if not shpList:
        #       cmds.removeMultiInstance("blinn1_TripleSwitch.{0}".format(tsInput))         

        for tsInput in tsList:
            shpList = cmds.connectionInfo("{0}.{1}.inShape".format(ts, tsInput), sfd=True).partition(".")
            shp = ""
            if shpList:
                shp = shpList[0]
            if shp == myShape:
                # clear out the shape node
                cmds.disconnectAttr("{0}.instObjGroups[0]".format(shp), "{0}.{1}.inShape".format(ts, tsInput))
                # clear out the texture (delete if we can)
                txt = cmds.connectionInfo("{0}.{1}.inTriple".format(ts, tsInput), sfd=True).partition(".")[0]
                cmds.disconnectAttr("{0}.outColor".format(txt), "{0}.{1}.inTriple".format(ts, tsInput))
                p2d = cmds.connectionInfo("{0}.uvCoord".format(txt), sfd=True).partition(".")[0]
                cmds.delete(txt, p2d)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号