def getInput(*args):
""" collects the input from the selected obj.channel"""
obj = ""
channel = ""
conv = cmds.checkBox(widgets["conversionCB"], q=True, v=True)
cBox = mel.eval('$temp=$gChannelBoxName')
sel = cmds.ls(sl=True, l=True)
if sel:
if not len(sel) == 1:
cmds.warning("You have to select ONE node!")
else:
obj = sel[0]
else:
cmds.warning("You have to select ONE node!")
if sel:
channels = cmds.channelBox(cBox, q=True, sma=True, ssa=True, sha=True, soa=True)
if channels:
if not len(channels) == 1:
cmds.warning("You have to select ONE channel!")
else:
channel = channels[0]
else:
cmds.warning("You have to select ONE channel!")
if obj and channel:
full = "%s.%s" % (obj, channel)
inAttr = cmds.listConnections(full, plugs=True, scn=conv, d=False, s=True)
if inAttr:
for each in inAttr:
print "%s -----> %s" % (each, full)
else:
cmds.warning("No input connections on this attr!")
inNodes = cmds.listConnections(full, scn=conv, d=False, s=True)
if inNodes:
cmds.select(cl=True)
for node in inNodes:
cmds.select(node, add=True)
评论列表
文章目录