码迷,mamicode.com
首页 > 其他好文 > 详细

printNodeConAttr

时间:2014-08-01 04:53:01      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   for   cti   div   line   

 
def printNodeConAttr():
    import re
    sellist = mc.ls(sl=1)
    all=[]
    D={}
    for a in sellist:
        lists = mc.listConnections(a,plugs=True,scn = True,c=1)
        for b in lists:    
            if re.findall(hyperLayoutandmessage,b):
                lists.remove(b)
        all.extend(lists)
    all=sorted(all)
    for attribute in all:
        if (mc.connectionInfo (attribute,isSource=True)) == True:
            if mc.connectionInfo (attribute,dfs=True):
                D[attribute]=mc.connectionInfo (attribute,dfs=True)[0]
    for key in D:
        out = mc.connectAttr(\‘%s.key1\‘%(key2),\‘%s.key3\‘%(key4),f=1).replace(key1,key.split(.)[1]).replace(key2,key.split(.)[0]).replace(key3,D[key].split(.)[1]).replace(key4,D[key].split(.)[0])
        print out
printNodeConAttr()

printNodeConAttr,布布扣,bubuko.com

printNodeConAttr

标签:style   blog   color   io   for   cti   div   line   

原文地址:http://www.cnblogs.com/jonn/p/printnodeconattr.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!