parentSwitch
def createParentNodeSwith(cNode,parentNode,addSwitchNode,attrName,switchName=None,select=0):
if switchName == None:
switchName = []
for i in parentNode:
switch.append(i.name())
addEnum = ":".join(switchName)
if addSwitchNode.hasAttr(attrName) != True:
addSwitchNode.addAttr(attrName,at="enum",en=addEnum,k=True)
addSwitchNode.attr(attrName).set(select)
switchAttr = []
for num in range(0,len(parentNode)):
constNode = pm.parentConstraint(parentNode[num],cNode,w=1,mo=True)
switchAttr.append(parentNode[num].name()+"W"+str(num))
for num in range(0,len(parentNode)):
cond = pm.createNode("condition")
addSwitchNode.attr(attrName) >> cond.firstTerm
cond.secondTerm.set(num)
cond.colorIfFalseR.set(0)
cond.colorIfTrueR.set(1)
cond.outColorR >> constNode.attr(switchAttr[num])