from ctrlUI_lib import createClav2, createSphere
import maya.cmds as cmds
import maya.OpenMaya as om
from functools import partial

def duplicateChain(*args):
    
    global ogChain
    global chainLen
    global switcherLoc
    global side
    global controllerColor
    global clavCheckbox
    global rigGrp, ctrlGrp
    
    ogRootchain = cmds.ls(sl = True, type = "joint")[0]        
    ogChain = cmds.listRelatives(ogRootchain, ad = True, type = "joint")
    ogChain.append(ogRootchain)
    ogChain.reverse()
    side = ogRootchain[0:2]

    # Initialize input from UI
    scaleController = cmds.intField(scaleField_UI, q=1, v=1)
    blendCheckbox = cmds.checkBox(blendCheckbox_UI, q=1, v=1) 
    constraintCheckBox = cmds.checkBox(constraintCheckBox_UI, q=1, v=1) 
    
    chainMenu = cmds.optionMenu("chainMenu_UI", q=1, v=1)

    clavCheckbox = cmds.checkBox(clavCheckbox_UI, q=1, v=0)

    if side == "l_": controllerColor = rgb=(0, 0, 255)
    elif side == "r_": controllerColor = rgb=(255, 0, 0)

    if chainMenu == "Leg": chainLen = 5
    else: #this is totally unscalable but for now it's ok
        chainLen = 3

    #suffix for the new chains
    newJointList = ["_ik", "_fk", "_scale"]
    for newJoint in newJointList:
        for i in range(chainLen):
            
            if blendCheckbox == 0 and constraintCheckBox == 0:
                cmds.error("pls, select one relation type")
                break

            newJointName = ogChain[i] + newJoint

            #create a joint, copy their position and freeze transform
            cmds.joint(n = newJointName)
            cmds.matchTransform(newJointName, ogChain[i])
            cmds.makeIdentity(newJointName, a = 1, t = 0, r = 1, s = 0)
        
        #deselect to make the two different hierarchies
        cmds.select(cl = 1)

    cmds.parent((ogChain[0] + "_ik"), world = True)
    cmds.setAttr(ogChain[0] + "_ik.visibility", 0)
    cmds.setAttr(ogChain[0] + "_fk.visibility", 0)

    # Create a locator used for switching IK/FK mode and snap it between two joints
    switcherLoc = cmds.spaceLocator(n=side + chainMenu + "_ikfk_Switch")
    switcherLocGrp = cmds.group(em=1, n=switcherLoc[0] + "_grp")
    cmds.color(switcherLoc, rgb=(255, 255, 0)) #yellow
    cmds.delete(cmds.pointConstraint(switcherLoc, switcherLocGrp))
    cmds.parent(switcherLoc, switcherLocGrp)
    cmds.delete(cmds.pointConstraint(ogChain[1], ogChain[2], switcherLocGrp))
    cmds.addAttr(switcherLoc, ln="FKIK_Mode", at="short", min=0, max=1, k=1, r=1)
    cmds.move(0,0,-12, switcherLocGrp, r=1) #IMPROVE THIS SHIT
    cmds.parentConstraint(ogChain[1], switcherLocGrp, mo=1)
    
    #remove .t, .r, .s and .v from the channelbox
    for coord in ["X", "Y", "Z"]:
        cmds.setAttr(switcherLoc[0] + ".translate" + coord, k=0, l=1)
        cmds.setAttr(switcherLoc[0] + ".rotate" + coord, k=0, l=1)
        cmds.setAttr(switcherLoc[0] + ".scale" + coord, k=0, l=1)
    cmds.setAttr(switcherLoc[0] + ".visibility", k=0, l=1)
    
    # Create hierarchy groups
    rigGrp = cmds.group(em=1, n= side + chainMenu + "_rig_grp")
    ctrlGrp = cmds.group(em=1, n= side + chainMenu + "_ctrl_grp")

    cmds.delete(cmds.parentConstraint(ogChain[0], rigGrp))
    cmds.delete(cmds.parentConstraint(ogChain[0], ctrlGrp))
    cmds.parent(ctrlGrp, rigGrp)

    # Execute
    if blendCheckbox == 1:
        blendNodeFunc(scaleController, chainMenu)
    
    if constraintCheckBox == 1:
        constraintFunc(scaleController, chainMenu)

    if clavCheckbox == 1:
        clavSel(scaleController)
    else:
        cmds.parent(ogChain[0] + "_ik", ogChain[0] + "_fk", ctrlGrp)
        cmds.parent(ogChain[0] + "_fk_anim_grp", ctrlGrp)
        cmds.parent(switcherLocGrp, rigGrp)
    

def clavSel(scaleClav):

    # Select clavicle Joint moving up and put it at the top of the chain
    clavJoint = cmds.pickWalk(ogChain[0], d="up")[0]
    #ogChain.insert(0, clavJoint)

    clavController = createClav2(clavJoint + "_anim") # Import coordinates from ctrlUI_lib
    cmds.delete(cmds.pointConstraint(clavJoint, clavController))

    # Create offset group, FDH and move up 
    clavControllerGrp = cmds.group(n=clavController + "_grp", em=1)
    cmds.delete(cmds.parentConstraint(clavJoint, clavControllerGrp))
    cmds.parent(clavController, clavControllerGrp)
    fixedScale = scaleClav/4
    cmds.scale(fixedScale, fixedScale, fixedScale, clavController)
    cmds.makeIdentity(clavController, a=1)
    cmds.move(0,10,0, clavControllerGrp, ws=1, r=1)
    cmds.color(clavController, rgb=controllerColor)
    
    # Move pivots on clavicle joint
    piv = cmds.xform(clavJoint, q=True, ws=True, t=True)
    cmds.xform(clavController, ws=True, piv=piv)
    cmds.xform(clavControllerGrp, ws=True, piv=piv)
    
    cmds.orientConstraint(clavController, clavJoint)

    # Parent ik and fk chain under clavicle controller    
    cmds.parent((ogChain[0]+"_fk_anim_grp"),(ogChain[0] + "_ik"), (ogChain[0] + "_fk"), clavController)

    cmds.parent(clavControllerGrp, ctrlGrp)


def visCheck(vis):
    if vis == "Arm":
        asd = True
    if vis == "Leg":
        asd = False
    cmds.checkBox(clavCheckbox_UI, e=1, vis=asd, v=asd)

# Buttons +1 and +3
count = 0

def addOneUnit(*args):
    global count
    count = count + 1
    cmds.intField(scaleField_UI, v=1+count, e=1)


def addThreeUnit(*args):
    global count
    count = count + 3
    cmds.intField(scaleField_UI, v=1+count, e=1)


def blendNodeFunc(scaleController, selectChain):

    # Create some blendColors node with the same name of the joint
    for x in range(chainLen):

        blendColorsNode = cmds.createNode("blendColors", n = ogChain[x] + "_blend")

        # Connect FK and IK chains into blendColors channels and then connect the output to the original joint chain
        cmds.connectAttr((ogChain[x] + "_ik.rotate"), blendColorsNode + ".color1")
        cmds.connectAttr((ogChain[x] + "_fk.rotate"), blendColorsNode + ".color2")
        cmds.connectAttr((blendColorsNode + ".output"), (ogChain[x] + ".rotate" ))
        cmds.connectAttr(switcherLoc[0]+".FKIK_Mode", blendColorsNode + ".blender")

    ikChainBuild(scaleController, selectChain)
    fkControllerCreator(scaleController, selectChain)


def constraintFunc(scaleController, selectChain):

    # Create some blendColors node with the same name of the joint
    for x in range(chainLen):
        
        # Setup orient constraints        
        cmds.parentConstraint((ogChain[x] + "_ik"), ogChain[x])
        cmds.parentConstraint((ogChain[x] + "_fk"), ogChain[x])

        # Setup SDK naming convention
        sdkDriver = switcherLoc[0] + ".FKIK_Mode"
        ikSdkDriven = ogChain[x] + "_parentConstraint1." + ogChain[x] + "_ikW0"
        fkSdkDriven = ogChain[x] + "_parentConstraint1." + ogChain[x] + "_fkW1"

        # Setup SDK
        cmds.setAttr(sdkDriver, 0)
        cmds.setDrivenKeyframe(ikSdkDriven, cd=sdkDriver, v=0, dv=0)
        cmds.setDrivenKeyframe(fkSdkDriven, cd=sdkDriver, v=1, dv=0)

        cmds.setAttr(sdkDriver, 1)
        cmds.setDrivenKeyframe(ikSdkDriven, cd=sdkDriver, v=1, dv=1)
        cmds.setDrivenKeyframe(fkSdkDriven, cd=sdkDriver, v=0, dv=1)

    
    ikChainBuild(scaleController, selectChain)
    fkControllerCreator(scaleController, selectChain)
    

def fkControllerCreator(fkSize, legOrArm):
    
    orientController = cmds.optionMenu("UI_orientControllerMenu", q=1, v=1)

    # Create controllers and group offsets
    # Change rotation, color
    for y in range(chainLen):
        anim_group = cmds.group(em=1, n=ogChain[y] + "_fk_anim_grp")
        fk_controller = cmds.circle(n=ogChain[y] + "_fk_anim")[0] # If not [0] it'll warn some stuff related to Maya underworld

        # Set scale 
        cmds.scale(fkSize, fkSize, fkSize, fk_controller)
            
        cmds.matchTransform(anim_group, ogChain[y])
        cmds.delete(cmds.parentConstraint(ogChain[y], fk_controller))
        cmds.parent(fk_controller, anim_group)

        # Set controller orientation based on second axis 
        if orientController == "x": cmds.rotate(90,0,0, fk_controller)
        if orientController == "y": cmds.rotate(0,90,0, fk_controller)
        if orientController == "z": cmds.rotate(0,0,90, fk_controller)
        
        # Freeze transform, delete history and set color
        cmds.makeIdentity(fk_controller, a = 1, t = 1, r = 1, s = 0)
        cmds.delete(fk_controller, ch = 1)
        cmds.color(fk_controller, rgb=controllerColor)
        
        # Set SDK visibility
        sdkDriver = switcherLoc[0] + ".FKIK_Mode"
        cmds.setAttr(sdkDriver, 1)
        cmds.setDrivenKeyframe(ogChain[0] + "_fk_anim_grp.visibility", cd=sdkDriver, v=1, dv=0)
        cmds.setAttr(sdkDriver, 0)
        cmds.setDrivenKeyframe(ogChain[0] + "_fk_anim_grp.visibility", cd=sdkDriver, v=0, dv=1)

        # Lock .t and .s attributes
        #for x in ["X", "Y", "Z"]:
            #cmds.setAttr(fk_controller + ".translate" + x, k=0, l=1)
            #cmds.setAttr(fk_controller + ".scale" + x, k=0, l=1)

    # Create ordered hierarchy
    for x in reversed(range(chainLen)):
        if x == 0:
            continue
        cmds.parent(ogChain[x] + "_fk_anim_grp", ogChain[x-1] + "_fk_anim")

    # Set orientConstraint _anim controllers with _fk hierarchy
    for x in range(chainLen):
        cmds.parentConstraint(ogChain[x] + "_fk_anim", ogChain[x] + "_fk")
        # If leg chain is selected delete toe controller, else not
        if legOrArm == "Leg":
            if x == (chainLen-1):
                cmds.delete(ogChain[chainLen-1] + "_fk_anim_grp")


def ikChainBuild(scaleIK, HandleName):
    
    masterIkHandle = cmds.ikHandle(sj=ogChain[0] + "_ik", ee=ogChain[2] + "_ik", sol="ikRPsolver", n=side + HandleName + "_ikHandle")
    cmds.setAttr(masterIkHandle[0] + ".visibility", 0)
    
    if HandleName == "Arm": 
        #print ("scaleController", scaleField_UI)
        armIk(scaleIK, masterIkHandle, HandleName)
    else:   
        #print ("scaleController", scaleField_UI)
        legIK(scaleIK, masterIkHandle, HandleName)


def armIk(armIkScale, armikHandle, pvName):

    ikHandJoint = cmds.joint(n=side + "hand_ik")
    cmds.delete(cmds.parentConstraint(ogChain[2] + "_ik", ikHandJoint))
    cmds.makeIdentity(ikHandJoint, a = 1, t = 1, r = 1, s = 0)
    if side == "l_":
        cmds.move(10,0,0, ikHandJoint, r=1, os=1)
    else:
        cmds.move(-10,0,0, ikHandJoint, r=1, os=1)
    cmds.parent(ikHandJoint, ogChain[2] + "_ik")
    handikHandle = cmds.ikHandle(sj=ogChain[2] + "_ik", ee=ikHandJoint, n=side + "hand_ikHandle", sol="ikSCsolver")
    cmds.parent(handikHandle[0], armikHandle[0])
    
    #create IK controller ---> CUBE
    crvIkCube = cmds.curve(d=1, p=[(-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (0.5, 0.5, 0.5),
                                    (-0.5, 0.5, 0.5), (-0.5, -0.5, 0.5), (-0.5, -0.5, -0.5),
                                    (-0.5, 0.5, -0.5), (-0.5, 0.5, 0.5), (-0.5, -0.5, 0.5),
                                    (0.5, -0.5, 0.5), (0.5, 0.5, 0.5), (0.5, 0.5, -0.5),
                                    (0.5, -0.5, -0.5), (0.5, -0.5, 0.5), (0.5, -0.5, -0.5), (-0.5, -0.5, -0.5)], 
                                    k=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5], n=side + "hand_ik_anim" )

    # Rename shape node                 
    shapeList = cmds.listRelatives(crvIkCube, s = True)
    cmds.rename(shapeList, crvIkCube + "Shape")
    
    crvIkCubeGrp = cmds.group(n=crvIkCube + "_grp")
    cmds.delete(cmds.parentConstraint(ogChain[2] + "_ik", crvIkCubeGrp))

    cmds.color(crvIkCube, rgb=controllerColor)
    cmds.scale(armIkScale, armIkScale, armIkScale, crvIkCubeGrp)

    cmds.parent(armikHandle[0], crvIkCube)

    pvController = createSphere(nome= side+pvName+"_PV")

    findPoleVector(loc=pvController, targetHandle=armikHandle[0])

    cmds.addAttr(pvController, at="enum", enumName = "------", ln="Attributes", k=1, r=1)
    cmds.addAttr(pvController, ln="Follow", k=1, r=1, min=0, max=1)
    cmds.addAttr(pvController, ln="Follow_Clav_Hand", k=1, r=1, min=0, max=1, dv=0.5)

    # Parent ikController and PV under _rig_GRP
    cmds.parent(crvIkCubeGrp, pvController + "_grp" ,rigGrp)
    
    #set SDK visibility
    sdkDriver = switcherLoc[0] + ".FKIK_Mode"
    cmds.setAttr(sdkDriver, 0)
    cmds.setDrivenKeyframe(crvIkCubeGrp + ".visibility", cd=sdkDriver, v=0, dv=0)
    cmds.setDrivenKeyframe(pvController + "_grp.visibility", cd=sdkDriver, v=0, dv=0)
    cmds.setAttr(sdkDriver, 1)
    cmds.setDrivenKeyframe(crvIkCubeGrp + ".visibility", cd=sdkDriver, v=1, dv=1)
    cmds.setDrivenKeyframe(pvController + "_grp.visibility", cd=sdkDriver, v=1, dv=1)

def legIK(ikFootScale, legikHandle, pvName):

    ballikHandle = cmds.ikHandle(sj=ogChain[2] + "_ik", ee=ogChain[3] + "_ik", sol="ikSCsolver", n=side + "ball_ikHandle")
    toeikHandle = cmds.ikHandle(sj=ogChain[3] + "_ik", ee=ogChain[4] + "_ik", sol="ikSCsolver", n=side + "toe_ikHandle")
    
    # Create and place ik controller
    ikFootControl = cmds.curve(d=2, p=[(0.997, 0, 1.789), (0, 0, 2.39), (-0.997,0,1.789), (-1.108, 0, 0), (-0.784, 0,-2.5),
              (0, 0,-3), (0.784, 0, -2.5), (1.108, 0, 0), (0.997, 0, 1.789), (0, 0, 2.39)],
              k=[0,1,2,3,4,5,6,7,8,9,10], n=side + "leg_anim_ik")

    # Rename shape node
    shapeList = cmds.listRelatives(ikFootControl, s = True)
    cmds.rename(shapeList, ikFootControl + "Shape")
              
    ikFootControlGrp = cmds.group(em=1, n=ikFootControl + "_grp")
    cmds.parent(ikFootControl, ikFootControlGrp)
    
    # Set size, freeze transform, create offset group and color
    cmds.scale(ikFootScale, ikFootScale, ikFootScale, ikFootControlGrp)  
    cmds.move(0,-3.2,0, ikFootControl, r=1)
    cmds.makeIdentity(ikFootControl, a = 1, t = 1, r = 1, s = 1)
    cmds.delete(ikFootControl, ch = 1)
    cmds.delete(cmds.pointConstraint(ogChain[3] + "_ik", ikFootControlGrp))
    cmds.color(ikFootControl, rgb=controllerColor) 
    
    # pivot snapping on ankle joint
    piv = cmds.xform(ogChain[2], q=True, ws=True, t=True)
    cmds.xform(ikFootControl, ws=True, piv=piv)

    cmds.parent(ballikHandle[0], toeikHandle[0], legikHandle[0], ikFootControl)
    
    #---------- Making Pole Vector -------------#
    # Pole Vector controller ---> Sphere
    pvController = createSphere(nome= side+pvName+"_PV")

    findPoleVector(loc=pvController, targetHandle=legikHandle[0])

    cmds.addAttr(pvController, ln="Follow", k=1, r=1, min=0, max=1)
    cmds.addAttr(pvController, ln="Follow_Leg_Foot", k=1, r=1, min=0, max=1, dv=0.5)
    
    # Create attributes on ikController
    cmds.addAttr(ikFootControl, at="enum",enumName = "------", ln="Attributes", k=1, r=1)
    cmds.addAttr(ikFootControl, ln="Twist", k=1, r=1)
    cmds.addAttr(ikFootControl, ln="Lateral_Roll", k=1, r=1)
    for bone in ["Ankle", "Ball", "Toe_Tap"]:
        cmds.addAttr(ikFootControl, at="enum", enumName = "------", ln=bone, k=1, r=1)
        for coord in ["X", "Y", "Z"]:
            cmds.addAttr(ikFootControl, ln=bone+coord, k=1, r=1)

    # Parent ikController and PV under _rig_GRP
    cmds.parent(ikFootControlGrp, pvController + "_grp" ,rigGrp)
    
    # Set SDK visibility
    sdkDriver = switcherLoc[0] + ".FKIK_Mode"
    cmds.setAttr(sdkDriver, 0)
    cmds.setDrivenKeyframe(ikFootControlGrp + ".visibility", cd=sdkDriver, v=0, dv=0)
    cmds.setDrivenKeyframe(pvController + "_grp.visibility", cd=sdkDriver, v=0, dv=0)
    cmds.setAttr(sdkDriver, 1)
    cmds.setDrivenKeyframe(ikFootControlGrp + ".visibility", cd=sdkDriver, v=1, dv=1)
    cmds.setDrivenKeyframe(pvController + "_grp.visibility", cd=sdkDriver, v=1, dv=1)
    
def findPoleVector(loc, targetHandle):

    # This func is kinda black magic
    # All credits to https://vimeo.com/66015036
    start = cmds.xform(ogChain[0], q=1, ws=1, t=1)
    mid = cmds.xform(ogChain[1], q=1, ws=1, t=1)
    end = cmds.xform(ogChain[2], q=1, ws=1, t=1)

    startV = om.MVector(start[0], start[1], start[2])
    midV = om.MVector(mid[0], mid[1], mid[2])
    endV = om.MVector(end[0], end[1], end[2])

    startEnd = endV - startV
    startMid = midV - startV

    dotP = startMid * startEnd
    proj = float(dotP) / float(startEnd.length())
    startEndN = startEnd.normal()
    projV = startEndN * proj

    arrowV = startMid - projV
    arrowV*= 10 #distance from joint
    finalV = arrowV + midV
    
    cmds.xform(loc, ws=1, t=(finalV.x, finalV.y ,finalV.z))

    locGrp = cmds.group(em=1, n=loc + "_grp")

    #snap, parent offsetGrp, set color and then make Constraint
    cmds.delete(cmds.pointConstraint(loc, locGrp))
    cmds.parent(loc, locGrp)
    cmds.makeIdentity(loc, a=1, t=1, r=1, s=1)
    cmds.color(loc, rgb=controllerColor)

    cmds.poleVectorConstraint(loc, targetHandle)


def showUI():
    
    global chainMenu_UI
    global scaleField_UI
    global orientControllerMenu
    global constraintCheckBox_UI
    global blendCheckbox_UI
    global plusOne_UI
    global plusThree_UI
    global clavCheckbox_UI
    
    if cmds.window("switchModeUI", ex = 1): cmds.deleteUI("switchModeUI")
    myWin = cmds.window("switchModeUI", t="IKFK Builder", w=300, h=300, s=1)
    mainLayout = cmds.formLayout(nd=50)
    
    # Useful in selecting which chain: Leg or Arm? 
    chainMenu_UI = cmds.optionMenu("chainMenu_UI", l="Which chain?", cc=visCheck)
    cmds.menuItem(l="Leg")
    cmds.menuItem(l="Arm")

    constraintCheckBox_UI = cmds.checkBox(label = "orientConsts+SDK Mode", v=0, 
                                          cc= lambda state: (cmds.checkBox(blendCheckbox_UI, e=1, en=state-1)))
    blendCheckbox_UI = cmds.checkBox(label = "blendColor Mode", v=0, 
                                     cc= lambda state: (cmds.checkBox(constraintCheckBox_UI, e=1, en=state-1)))

    clavCheckbox_UI = cmds.checkBox(l="Clavicle", vis=0)

    # Useful in orienting FK controllers as the user wishes. Maybe this can be improved
    orientControllerMenu = cmds.optionMenu("UI_orientControllerMenu", l="What's the secondary axis")
    cmds.menuItem(l="x")
    cmds.menuItem(l="y")
    cmds.menuItem(l="z")

    # Scale the UI becase you'll never know
    scaleControllerText = cmds.text(l="Controllers size")
    scaleField_UI = cmds.intField(en=10, v=1, min=1)

    plusOne_UI = cmds.button(l="+1", c=addOneUnit)
    plusThree_UI = cmds.button(l="+3", c=addThreeUnit)
    
    separator01 = cmds.separator(h=5)
    separator02 = cmds.separator(h=5)

    #
    execButton = cmds.button(l="Duplicate Chain", c=partial(duplicateChain, blendNodeFunc, constraintFunc))

    cmds.formLayout(mainLayout, e=1,
                    attachForm = [
                        (chainMenu_UI, "left", 8), (chainMenu_UI, "top", 5), (chainMenu_UI, "right", 80),
                        (clavCheckbox_UI, "top", 7),
                        (blendCheckbox_UI, "left", 5),
                        (separator01, "left", 1), (separator01, "right", 2),
                        #--------------------
                        
                        (scaleField_UI, "right", 65), (scaleField_UI, "left", 5),
                        (plusOne_UI, "right", 5), 
                        (plusThree_UI, "right", 5),
                        (scaleControllerText, "left", 5),
                        (separator02, "left", 1), (separator02, "right", 2),
                        #--------------------
                        
                        (orientControllerMenu, "left", 8), (orientControllerMenu, "top", 5),
                        #--------------------
                        
                        (execButton, "bottom", 5), (execButton, "left", 5), (execButton, "right", 5),
                    ],
                    attachControl = [(clavCheckbox_UI, "left", 10, chainMenu_UI),
                                     (constraintCheckBox_UI, "top", 5, chainMenu_UI),
                                     (blendCheckbox_UI, "top", 5, chainMenu_UI),
                                     (separator01, "top", 5, constraintCheckBox_UI),
                                     (scaleField_UI, "top", 5, separator01),
                                     (scaleControllerText, "top", 8, separator01),
                                     (plusOne_UI, "top", 4, separator01),
                                     (plusThree_UI, "top", 4, separator01),
                                     (separator02, "top", 6, scaleField_UI),
                                     (orientControllerMenu, "top", 6, separator02),
                    
                    ],
                    
                    attachPosition = [#(clavCheckbox_UI, "right", 0, 10),
                                      (constraintCheckBox_UI, "left", 0, 26), (blendCheckbox_UI, "right", 10, 24),
                                      (scaleControllerText, "left", 5, 0), (scaleField_UI, "left", 110, 0), #(scaleField_UI, "right",0, 40),
                                      (plusOne_UI, "right", 0, 45),
                                      (plusThree_UI, "right", 0, 49)
                    ]
    
    
    )
    
    cmds.showWindow(myWin)
    
showUI()
[((403, 457), 'maya.cmds.listRelatives', 'cmds.listRelatives', (['ogRootchain'], {'ad': '(True)', 'type': '"""joint"""'}), "(ogRootchain, ad=True, type='joint')\n", (421, 457), True, 'import maya.cmds as cmds\n'), ((598, 636), 'maya.cmds.intField', 'cmds.intField', (['scaleField_UI'], {'q': '(1)', 'v': '(1)'}), '(scaleField_UI, q=1, v=1)\n', (611, 636), True, 'import maya.cmds as cmds\n'), ((657, 698), 'maya.cmds.checkBox', 'cmds.checkBox', (['blendCheckbox_UI'], {'q': '(1)', 'v': '(1)'}), '(blendCheckbox_UI, q=1, v=1)\n', (670, 698), True, 'import maya.cmds as cmds\n'), ((725, 771), 'maya.cmds.checkBox', 'cmds.checkBox', (['constraintCheckBox_UI'], {'q': '(1)', 'v': '(1)'}), '(constraintCheckBox_UI, q=1, v=1)\n', (738, 771), True, 'import maya.cmds as cmds\n'), ((794, 835), 'maya.cmds.optionMenu', 'cmds.optionMenu', (['"""chainMenu_UI"""'], {'q': '(1)', 'v': '(1)'}), "('chainMenu_UI', q=1, v=1)\n", (809, 835), True, 'import maya.cmds as cmds\n'), ((856, 896), 'maya.cmds.checkBox', 'cmds.checkBox', (['clavCheckbox_UI'], {'q': '(1)', 'v': '(0)'}), '(clavCheckbox_UI, q=1, v=0)\n', (869, 896), True, 'import maya.cmds as cmds\n'), ((1822, 1865), 'maya.cmds.parent', 'cmds.parent', (["(ogChain[0] + '_ik')"], {'world': '(True)'}), "(ogChain[0] + '_ik', world=True)\n", (1833, 1865), True, 'import maya.cmds as cmds\n'), ((1874, 1920), 'maya.cmds.setAttr', 'cmds.setAttr', (["(ogChain[0] + '_ik.visibility')", '(0)'], {}), "(ogChain[0] + '_ik.visibility', 0)\n", (1886, 1920), True, 'import maya.cmds as cmds\n'), ((1925, 1971), 'maya.cmds.setAttr', 'cmds.setAttr', (["(ogChain[0] + '_fk.visibility')", '(0)'], {}), "(ogChain[0] + '_fk.visibility', 0)\n", (1937, 1971), True, 'import maya.cmds as cmds\n'), ((2075, 2129), 'maya.cmds.spaceLocator', 'cmds.spaceLocator', ([], {'n': "(side + chainMenu + '_ikfk_Switch')"}), "(n=side + chainMenu + '_ikfk_Switch')\n", (2092, 2129), True, 'import maya.cmds as cmds\n'), ((2151, 2194), 'maya.cmds.group', 'cmds.group', ([], {'em': '(1)', 'n': "(switcherLoc[0] + '_grp')"}), "(em=1, n=switcherLoc[0] + '_grp')\n", (2161, 2194), True, 'import maya.cmds as cmds\n'), ((2199, 2241), 'maya.cmds.color', 'cmds.color', (['switcherLoc'], {'rgb': '(255, 255, 0)'}), '(switcherLoc, rgb=(255, 255, 0))\n', (2209, 2241), True, 'import maya.cmds as cmds\n'), ((2321, 2361), 'maya.cmds.parent', 'cmds.parent', (['switcherLoc', 'switcherLocGrp'], {}), '(switcherLoc, switcherLocGrp)\n', (2332, 2361), True, 'import maya.cmds as cmds\n'), ((2444, 2521), 'maya.cmds.addAttr', 'cmds.addAttr', (['switcherLoc'], {'ln': '"""FKIK_Mode"""', 'at': '"""short"""', 'min': '(0)', 'max': '(1)', 'k': '(1)', 'r': '(1)'}), "(switcherLoc, ln='FKIK_Mode', at='short', min=0, max=1, k=1, r=1)\n", (2456, 2521), True, 'import maya.cmds as cmds\n'), ((2526, 2567), 'maya.cmds.move', 'cmds.move', (['(0)', '(0)', '(-12)', 'switcherLocGrp'], {'r': '(1)'}), '(0, 0, -12, switcherLocGrp, r=1)\n', (2535, 2567), True, 'import maya.cmds as cmds\n'), ((2589, 2644), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (['ogChain[1]', 'switcherLocGrp'], {'mo': '(1)'}), '(ogChain[1], switcherLocGrp, mo=1)\n', (2610, 2644), True, 'import maya.cmds as cmds\n'), ((2941, 2995), 'maya.cmds.setAttr', 'cmds.setAttr', (["(switcherLoc[0] + '.visibility')"], {'k': '(0)', 'l': '(1)'}), "(switcherLoc[0] + '.visibility', k=0, l=1)\n", (2953, 2995), True, 'import maya.cmds as cmds\n'), ((3044, 3093), 'maya.cmds.group', 'cmds.group', ([], {'em': '(1)', 'n': "(side + chainMenu + '_rig_grp')"}), "(em=1, n=side + chainMenu + '_rig_grp')\n", (3054, 3093), True, 'import maya.cmds as cmds\n'), ((3109, 3159), 'maya.cmds.group', 'cmds.group', ([], {'em': '(1)', 'n': "(side + chainMenu + '_ctrl_grp')"}), "(em=1, n=side + chainMenu + '_ctrl_grp')\n", (3119, 3159), True, 'import maya.cmds as cmds\n'), ((3285, 3313), 'maya.cmds.parent', 'cmds.parent', (['ctrlGrp', 'rigGrp'], {}), '(ctrlGrp, rigGrp)\n', (3296, 3313), True, 'import maya.cmds as cmds\n'), ((3948, 3980), 'ctrlUI_lib.createClav2', 'createClav2', (["(clavJoint + '_anim')"], {}), "(clavJoint + '_anim')\n", (3959, 3980), False, 'from ctrlUI_lib import createClav2, createSphere\n'), ((4152, 4195), 'maya.cmds.group', 'cmds.group', ([], {'n': "(clavController + '_grp')", 'em': '(1)'}), "(n=clavController + '_grp', em=1)\n", (4162, 4195), True, 'import maya.cmds as cmds\n'), ((4269, 4315), 'maya.cmds.parent', 'cmds.parent', (['clavController', 'clavControllerGrp'], {}), '(clavController, clavControllerGrp)\n', (4280, 4315), True, 'import maya.cmds as cmds\n'), ((4349, 4411), 'maya.cmds.scale', 'cmds.scale', (['fixedScale', 'fixedScale', 'fixedScale', 'clavController'], {}), '(fixedScale, fixedScale, fixedScale, clavController)\n', (4359, 4411), True, 'import maya.cmds as cmds\n'), ((4416, 4454), 'maya.cmds.makeIdentity', 'cmds.makeIdentity', (['clavController'], {'a': '(1)'}), '(clavController, a=1)\n', (4433, 4454), True, 'import maya.cmds as cmds\n'), ((4459, 4508), 'maya.cmds.move', 'cmds.move', (['(0)', '(10)', '(0)', 'clavControllerGrp'], {'ws': '(1)', 'r': '(1)'}), '(0, 10, 0, clavControllerGrp, ws=1, r=1)\n', (4468, 4508), True, 'import maya.cmds as cmds\n'), ((4511, 4558), 'maya.cmds.color', 'cmds.color', (['clavController'], {'rgb': 'controllerColor'}), '(clavController, rgb=controllerColor)\n', (4521, 4558), True, 'import maya.cmds as cmds\n'), ((4610, 4656), 'maya.cmds.xform', 'cmds.xform', (['clavJoint'], {'q': '(True)', 'ws': '(True)', 't': '(True)'}), '(clavJoint, q=True, ws=True, t=True)\n', (4620, 4656), True, 'import maya.cmds as cmds\n'), ((4661, 4705), 'maya.cmds.xform', 'cmds.xform', (['clavController'], {'ws': '(True)', 'piv': 'piv'}), '(clavController, ws=True, piv=piv)\n', (4671, 4705), True, 'import maya.cmds as cmds\n'), ((4710, 4757), 'maya.cmds.xform', 'cmds.xform', (['clavControllerGrp'], {'ws': '(True)', 'piv': 'piv'}), '(clavControllerGrp, ws=True, piv=piv)\n', (4720, 4757), True, 'import maya.cmds as cmds\n'), ((4767, 4815), 'maya.cmds.orientConstraint', 'cmds.orientConstraint', (['clavController', 'clavJoint'], {}), '(clavController, clavJoint)\n', (4788, 4815), True, 'import maya.cmds as cmds\n'), ((4880, 4980), 'maya.cmds.parent', 'cmds.parent', (["(ogChain[0] + '_fk_anim_grp')", "(ogChain[0] + '_ik')", "(ogChain[0] + '_fk')", 'clavController'], {}), "(ogChain[0] + '_fk_anim_grp', ogChain[0] + '_ik', ogChain[0] +\n    '_fk', clavController)\n", (4891, 4980), True, 'import maya.cmds as cmds\n'), ((4985, 5024), 'maya.cmds.parent', 'cmds.parent', (['clavControllerGrp', 'ctrlGrp'], {}), '(clavControllerGrp, ctrlGrp)\n', (4996, 5024), True, 'import maya.cmds as cmds\n'), ((5131, 5182), 'maya.cmds.checkBox', 'cmds.checkBox', (['clavCheckbox_UI'], {'e': '(1)', 'vis': 'asd', 'v': 'asd'}), '(clavCheckbox_UI, e=1, vis=asd, v=asd)\n', (5144, 5182), True, 'import maya.cmds as cmds\n'), ((5281, 5327), 'maya.cmds.intField', 'cmds.intField', (['scaleField_UI'], {'v': '(1 + count)', 'e': '(1)'}), '(scaleField_UI, v=1 + count, e=1)\n', (5294, 5327), True, 'import maya.cmds as cmds\n'), ((5396, 5442), 'maya.cmds.intField', 'cmds.intField', (['scaleField_UI'], {'v': '(1 + count)', 'e': '(1)'}), '(scaleField_UI, v=1 + count, e=1)\n', (5409, 5442), True, 'import maya.cmds as cmds\n'), ((7359, 7411), 'maya.cmds.optionMenu', 'cmds.optionMenu', (['"""UI_orientControllerMenu"""'], {'q': '(1)', 'v': '(1)'}), "('UI_orientControllerMenu', q=1, v=1)\n", (7374, 7411), True, 'import maya.cmds as cmds\n'), ((9660, 9777), 'maya.cmds.ikHandle', 'cmds.ikHandle', ([], {'sj': "(ogChain[0] + '_ik')", 'ee': "(ogChain[2] + '_ik')", 'sol': '"""ikRPsolver"""', 'n': "(side + HandleName + '_ikHandle')"}), "(sj=ogChain[0] + '_ik', ee=ogChain[2] + '_ik', sol=\n    'ikRPsolver', n=side + HandleName + '_ikHandle')\n", (9673, 9777), True, 'import maya.cmds as cmds\n'), ((9777, 9827), 'maya.cmds.setAttr', 'cmds.setAttr', (["(masterIkHandle[0] + '.visibility')", '(0)'], {}), "(masterIkHandle[0] + '.visibility', 0)\n", (9789, 9827), True, 'import maya.cmds as cmds\n'), ((10142, 10172), 'maya.cmds.joint', 'cmds.joint', ([], {'n': "(side + 'hand_ik')"}), "(n=side + 'hand_ik')\n", (10152, 10172), True, 'import maya.cmds as cmds\n'), ((10249, 10299), 'maya.cmds.makeIdentity', 'cmds.makeIdentity', (['ikHandJoint'], {'a': '(1)', 't': '(1)', 'r': '(1)', 's': '(0)'}), '(ikHandJoint, a=1, t=1, r=1, s=0)\n', (10266, 10299), True, 'import maya.cmds as cmds\n'), ((10444, 10488), 'maya.cmds.parent', 'cmds.parent', (['ikHandJoint', "(ogChain[2] + '_ik')"], {}), "(ikHandJoint, ogChain[2] + '_ik')\n", (10455, 10488), True, 'import maya.cmds as cmds\n'), ((10508, 10608), 'maya.cmds.ikHandle', 'cmds.ikHandle', ([], {'sj': "(ogChain[2] + '_ik')", 'ee': 'ikHandJoint', 'n': "(side + 'hand_ikHandle')", 'sol': '"""ikSCsolver"""'}), "(sj=ogChain[2] + '_ik', ee=ikHandJoint, n=side +\n    'hand_ikHandle', sol='ikSCsolver')\n", (10521, 10608), True, 'import maya.cmds as cmds\n'), ((10609, 10653), 'maya.cmds.parent', 'cmds.parent', (['handikHandle[0]', 'armikHandle[0]'], {}), '(handikHandle[0], armikHandle[0])\n', (10620, 10653), True, 'import maya.cmds as cmds\n'), ((10711, 11139), 'maya.cmds.curve', 'cmds.curve', ([], {'d': '(1)', 'p': '[(-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, 0.5), (-\n    0.5, -0.5, 0.5), (-0.5, -0.5, -0.5), (-0.5, 0.5, -0.5), (-0.5, 0.5, 0.5\n    ), (-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (0.5, 0.5, 0.5), (0.5, 0.5, -\n    0.5), (0.5, -0.5, -0.5), (0.5, -0.5, 0.5), (0.5, -0.5, -0.5), (-0.5, -\n    0.5, -0.5)]', 'k': '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]', 'n': "(side + 'hand_ik_anim')"}), "(d=1, p=[(-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (0.5, 0.5, 0.5), (-\n    0.5, 0.5, 0.5), (-0.5, -0.5, 0.5), (-0.5, -0.5, -0.5), (-0.5, 0.5, -0.5\n    ), (-0.5, 0.5, 0.5), (-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (0.5, 0.5, \n    0.5), (0.5, 0.5, -0.5), (0.5, -0.5, -0.5), (0.5, -0.5, 0.5), (0.5, -0.5,\n    -0.5), (-0.5, -0.5, -0.5)], k=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1.0, 1.1, \n    1.2, 1.3, 1.4, 1.5], n=side + 'hand_ik_anim')\n", (10721, 11139), True, 'import maya.cmds as cmds\n'), ((11356, 11393), 'maya.cmds.listRelatives', 'cmds.listRelatives', (['crvIkCube'], {'s': '(True)'}), '(crvIkCube, s=True)\n', (11374, 11393), True, 'import maya.cmds as cmds\n'), ((11400, 11443), 'maya.cmds.rename', 'cmds.rename', (['shapeList', "(crvIkCube + 'Shape')"], {}), "(shapeList, crvIkCube + 'Shape')\n", (11411, 11443), True, 'import maya.cmds as cmds\n'), ((11468, 11500), 'maya.cmds.group', 'cmds.group', ([], {'n': "(crvIkCube + '_grp')"}), "(n=crvIkCube + '_grp')\n", (11478, 11500), True, 'import maya.cmds as cmds\n'), ((11579, 11621), 'maya.cmds.color', 'cmds.color', (['crvIkCube'], {'rgb': 'controllerColor'}), '(crvIkCube, rgb=controllerColor)\n', (11589, 11621), True, 'import maya.cmds as cmds\n'), ((11626, 11686), 'maya.cmds.scale', 'cmds.scale', (['armIkScale', 'armIkScale', 'armIkScale', 'crvIkCubeGrp'], {}), '(armIkScale, armIkScale, armIkScale, crvIkCubeGrp)\n', (11636, 11686), True, 'import maya.cmds as cmds\n'), ((11692, 11730), 'maya.cmds.parent', 'cmds.parent', (['armikHandle[0]', 'crvIkCube'], {}), '(armikHandle[0], crvIkCube)\n', (11703, 11730), True, 'import maya.cmds as cmds\n'), ((11751, 11791), 'ctrlUI_lib.createSphere', 'createSphere', ([], {'nome': "(side + pvName + '_PV')"}), "(nome=side + pvName + '_PV')\n", (11763, 11791), False, 'from ctrlUI_lib import createClav2, createSphere\n'), ((11861, 11949), 'maya.cmds.addAttr', 'cmds.addAttr', (['pvController'], {'at': '"""enum"""', 'enumName': '"""------"""', 'ln': '"""Attributes"""', 'k': '(1)', 'r': '(1)'}), "(pvController, at='enum', enumName='------', ln='Attributes', k\n    =1, r=1)\n", (11873, 11949), True, 'import maya.cmds as cmds\n'), ((11951, 12014), 'maya.cmds.addAttr', 'cmds.addAttr', (['pvController'], {'ln': '"""Follow"""', 'k': '(1)', 'r': '(1)', 'min': '(0)', 'max': '(1)'}), "(pvController, ln='Follow', k=1, r=1, min=0, max=1)\n", (11963, 12014), True, 'import maya.cmds as cmds\n'), ((12019, 12104), 'maya.cmds.addAttr', 'cmds.addAttr', (['pvController'], {'ln': '"""Follow_Clav_Hand"""', 'k': '(1)', 'r': '(1)', 'min': '(0)', 'max': '(1)', 'dv': '(0.5)'}), "(pvController, ln='Follow_Clav_Hand', k=1, r=1, min=0, max=1,\n    dv=0.5)\n", (12031, 12104), True, 'import maya.cmds as cmds\n'), ((12154, 12210), 'maya.cmds.parent', 'cmds.parent', (['crvIkCubeGrp', "(pvController + '_grp')", 'rigGrp'], {}), "(crvIkCubeGrp, pvController + '_grp', rigGrp)\n", (12165, 12210), True, 'import maya.cmds as cmds\n'), ((12290, 12316), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(0)'], {}), '(sdkDriver, 0)\n', (12302, 12316), True, 'import maya.cmds as cmds\n'), ((12321, 12398), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(crvIkCubeGrp + '.visibility')"], {'cd': 'sdkDriver', 'v': '(0)', 'dv': '(0)'}), "(crvIkCubeGrp + '.visibility', cd=sdkDriver, v=0, dv=0)\n", (12343, 12398), True, 'import maya.cmds as cmds\n'), ((12403, 12488), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(pvController + '_grp.visibility')"], {'cd': 'sdkDriver', 'v': '(0)', 'dv': '(0)'}), "(pvController + '_grp.visibility', cd=sdkDriver, v=0,\n    dv=0)\n", (12425, 12488), True, 'import maya.cmds as cmds\n'), ((12489, 12515), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(1)'], {}), '(sdkDriver, 1)\n', (12501, 12515), True, 'import maya.cmds as cmds\n'), ((12520, 12597), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(crvIkCubeGrp + '.visibility')"], {'cd': 'sdkDriver', 'v': '(1)', 'dv': '(1)'}), "(crvIkCubeGrp + '.visibility', cd=sdkDriver, v=1, dv=1)\n", (12542, 12597), True, 'import maya.cmds as cmds\n'), ((12602, 12687), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(pvController + '_grp.visibility')"], {'cd': 'sdkDriver', 'v': '(1)', 'dv': '(1)'}), "(pvController + '_grp.visibility', cd=sdkDriver, v=1,\n    dv=1)\n", (12624, 12687), True, 'import maya.cmds as cmds\n'), ((12750, 12858), 'maya.cmds.ikHandle', 'cmds.ikHandle', ([], {'sj': "(ogChain[2] + '_ik')", 'ee': "(ogChain[3] + '_ik')", 'sol': '"""ikSCsolver"""', 'n': "(side + 'ball_ikHandle')"}), "(sj=ogChain[2] + '_ik', ee=ogChain[3] + '_ik', sol=\n    'ikSCsolver', n=side + 'ball_ikHandle')\n", (12763, 12858), True, 'import maya.cmds as cmds\n'), ((12872, 12979), 'maya.cmds.ikHandle', 'cmds.ikHandle', ([], {'sj': "(ogChain[3] + '_ik')", 'ee': "(ogChain[4] + '_ik')", 'sol': '"""ikSCsolver"""', 'n': "(side + 'toe_ikHandle')"}), "(sj=ogChain[3] + '_ik', ee=ogChain[4] + '_ik', sol=\n    'ikSCsolver', n=side + 'toe_ikHandle')\n", (12885, 12979), True, 'import maya.cmds as cmds\n'), ((13037, 13299), 'maya.cmds.curve', 'cmds.curve', ([], {'d': '(2)', 'p': '[(0.997, 0, 1.789), (0, 0, 2.39), (-0.997, 0, 1.789), (-1.108, 0, 0), (-\n    0.784, 0, -2.5), (0, 0, -3), (0.784, 0, -2.5), (1.108, 0, 0), (0.997, 0,\n    1.789), (0, 0, 2.39)]', 'k': '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]', 'n': "(side + 'leg_anim_ik')"}), "(d=2, p=[(0.997, 0, 1.789), (0, 0, 2.39), (-0.997, 0, 1.789), (-\n    1.108, 0, 0), (-0.784, 0, -2.5), (0, 0, -3), (0.784, 0, -2.5), (1.108, \n    0, 0), (0.997, 0, 1.789), (0, 0, 2.39)], k=[0, 1, 2, 3, 4, 5, 6, 7, 8, \n    9, 10], n=side + 'leg_anim_ik')\n", (13047, 13299), True, 'import maya.cmds as cmds\n'), ((13340, 13381), 'maya.cmds.listRelatives', 'cmds.listRelatives', (['ikFootControl'], {'s': '(True)'}), '(ikFootControl, s=True)\n', (13358, 13381), True, 'import maya.cmds as cmds\n'), ((13388, 13435), 'maya.cmds.rename', 'cmds.rename', (['shapeList', "(ikFootControl + 'Shape')"], {}), "(shapeList, ikFootControl + 'Shape')\n", (13399, 13435), True, 'import maya.cmds as cmds\n'), ((13474, 13516), 'maya.cmds.group', 'cmds.group', ([], {'em': '(1)', 'n': "(ikFootControl + '_grp')"}), "(em=1, n=ikFootControl + '_grp')\n", (13484, 13516), True, 'import maya.cmds as cmds\n'), ((13521, 13565), 'maya.cmds.parent', 'cmds.parent', (['ikFootControl', 'ikFootControlGrp'], {}), '(ikFootControl, ikFootControlGrp)\n', (13532, 13565), True, 'import maya.cmds as cmds\n'), ((13639, 13706), 'maya.cmds.scale', 'cmds.scale', (['ikFootScale', 'ikFootScale', 'ikFootScale', 'ikFootControlGrp'], {}), '(ikFootScale, ikFootScale, ikFootScale, ikFootControlGrp)\n', (13649, 13706), True, 'import maya.cmds as cmds\n'), ((13713, 13754), 'maya.cmds.move', 'cmds.move', (['(0)', '(-3.2)', '(0)', 'ikFootControl'], {'r': '(1)'}), '(0, -3.2, 0, ikFootControl, r=1)\n', (13722, 13754), True, 'import maya.cmds as cmds\n'), ((13757, 13809), 'maya.cmds.makeIdentity', 'cmds.makeIdentity', (['ikFootControl'], {'a': '(1)', 't': '(1)', 'r': '(1)', 's': '(1)'}), '(ikFootControl, a=1, t=1, r=1, s=1)\n', (13774, 13809), True, 'import maya.cmds as cmds\n'), ((13822, 13854), 'maya.cmds.delete', 'cmds.delete', (['ikFootControl'], {'ch': '(1)'}), '(ikFootControl, ch=1)\n', (13833, 13854), True, 'import maya.cmds as cmds\n'), ((13937, 13983), 'maya.cmds.color', 'cmds.color', (['ikFootControl'], {'rgb': 'controllerColor'}), '(ikFootControl, rgb=controllerColor)\n', (13947, 13983), True, 'import maya.cmds as cmds\n'), ((14036, 14083), 'maya.cmds.xform', 'cmds.xform', (['ogChain[2]'], {'q': '(True)', 'ws': '(True)', 't': '(True)'}), '(ogChain[2], q=True, ws=True, t=True)\n', (14046, 14083), True, 'import maya.cmds as cmds\n'), ((14088, 14131), 'maya.cmds.xform', 'cmds.xform', (['ikFootControl'], {'ws': '(True)', 'piv': 'piv'}), '(ikFootControl, ws=True, piv=piv)\n', (14098, 14131), True, 'import maya.cmds as cmds\n'), ((14137, 14212), 'maya.cmds.parent', 'cmds.parent', (['ballikHandle[0]', 'toeikHandle[0]', 'legikHandle[0]', 'ikFootControl'], {}), '(ballikHandle[0], toeikHandle[0], legikHandle[0], ikFootControl)\n', (14148, 14212), True, 'import maya.cmds as cmds\n'), ((14328, 14368), 'ctrlUI_lib.createSphere', 'createSphere', ([], {'nome': "(side + pvName + '_PV')"}), "(nome=side + pvName + '_PV')\n", (14340, 14368), False, 'from ctrlUI_lib import createClav2, createSphere\n'), ((14438, 14501), 'maya.cmds.addAttr', 'cmds.addAttr', (['pvController'], {'ln': '"""Follow"""', 'k': '(1)', 'r': '(1)', 'min': '(0)', 'max': '(1)'}), "(pvController, ln='Follow', k=1, r=1, min=0, max=1)\n", (14450, 14501), True, 'import maya.cmds as cmds\n'), ((14506, 14591), 'maya.cmds.addAttr', 'cmds.addAttr', (['pvController'], {'ln': '"""Follow_Leg_Foot"""', 'k': '(1)', 'r': '(1)', 'min': '(0)', 'max': '(1)', 'dv': '(0.5)'}), "(pvController, ln='Follow_Leg_Foot', k=1, r=1, min=0, max=1, dv=0.5\n    )\n", (14518, 14591), True, 'import maya.cmds as cmds\n'), ((14636, 14724), 'maya.cmds.addAttr', 'cmds.addAttr', (['ikFootControl'], {'at': '"""enum"""', 'enumName': '"""------"""', 'ln': '"""Attributes"""', 'k': '(1)', 'r': '(1)'}), "(ikFootControl, at='enum', enumName='------', ln='Attributes',\n    k=1, r=1)\n", (14648, 14724), True, 'import maya.cmds as cmds\n'), ((14726, 14775), 'maya.cmds.addAttr', 'cmds.addAttr', (['ikFootControl'], {'ln': '"""Twist"""', 'k': '(1)', 'r': '(1)'}), "(ikFootControl, ln='Twist', k=1, r=1)\n", (14738, 14775), True, 'import maya.cmds as cmds\n'), ((14780, 14836), 'maya.cmds.addAttr', 'cmds.addAttr', (['ikFootControl'], {'ln': '"""Lateral_Roll"""', 'k': '(1)', 'r': '(1)'}), "(ikFootControl, ln='Lateral_Roll', k=1, r=1)\n", (14792, 14836), True, 'import maya.cmds as cmds\n'), ((15126, 15186), 'maya.cmds.parent', 'cmds.parent', (['ikFootControlGrp', "(pvController + '_grp')", 'rigGrp'], {}), "(ikFootControlGrp, pvController + '_grp', rigGrp)\n", (15137, 15186), True, 'import maya.cmds as cmds\n'), ((15267, 15293), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(0)'], {}), '(sdkDriver, 0)\n', (15279, 15293), True, 'import maya.cmds as cmds\n'), ((15298, 15383), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(ikFootControlGrp + '.visibility')"], {'cd': 'sdkDriver', 'v': '(0)', 'dv': '(0)'}), "(ikFootControlGrp + '.visibility', cd=sdkDriver, v=0,\n    dv=0)\n", (15320, 15383), True, 'import maya.cmds as cmds\n'), ((15384, 15469), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(pvController + '_grp.visibility')"], {'cd': 'sdkDriver', 'v': '(0)', 'dv': '(0)'}), "(pvController + '_grp.visibility', cd=sdkDriver, v=0,\n    dv=0)\n", (15406, 15469), True, 'import maya.cmds as cmds\n'), ((15470, 15496), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(1)'], {}), '(sdkDriver, 1)\n', (15482, 15496), True, 'import maya.cmds as cmds\n'), ((15501, 15586), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(ikFootControlGrp + '.visibility')"], {'cd': 'sdkDriver', 'v': '(1)', 'dv': '(1)'}), "(ikFootControlGrp + '.visibility', cd=sdkDriver, v=1,\n    dv=1)\n", (15523, 15586), True, 'import maya.cmds as cmds\n'), ((15587, 15672), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(pvController + '_grp.visibility')"], {'cd': 'sdkDriver', 'v': '(1)', 'dv': '(1)'}), "(pvController + '_grp.visibility', cd=sdkDriver, v=1,\n    dv=1)\n", (15609, 15672), True, 'import maya.cmds as cmds\n'), ((15811, 15849), 'maya.cmds.xform', 'cmds.xform', (['ogChain[0]'], {'q': '(1)', 'ws': '(1)', 't': '(1)'}), '(ogChain[0], q=1, ws=1, t=1)\n', (15821, 15849), True, 'import maya.cmds as cmds\n'), ((15860, 15898), 'maya.cmds.xform', 'cmds.xform', (['ogChain[1]'], {'q': '(1)', 'ws': '(1)', 't': '(1)'}), '(ogChain[1], q=1, ws=1, t=1)\n', (15870, 15898), True, 'import maya.cmds as cmds\n'), ((15909, 15947), 'maya.cmds.xform', 'cmds.xform', (['ogChain[2]'], {'q': '(1)', 'ws': '(1)', 't': '(1)'}), '(ogChain[2], q=1, ws=1, t=1)\n', (15919, 15947), True, 'import maya.cmds as cmds\n'), ((15962, 16002), 'maya.OpenMaya.MVector', 'om.MVector', (['start[0]', 'start[1]', 'start[2]'], {}), '(start[0], start[1], start[2])\n', (15972, 16002), True, 'import maya.OpenMaya as om\n'), ((16014, 16048), 'maya.OpenMaya.MVector', 'om.MVector', (['mid[0]', 'mid[1]', 'mid[2]'], {}), '(mid[0], mid[1], mid[2])\n', (16024, 16048), True, 'import maya.OpenMaya as om\n'), ((16060, 16094), 'maya.OpenMaya.MVector', 'om.MVector', (['end[0]', 'end[1]', 'end[2]'], {}), '(end[0], end[1], end[2])\n', (16070, 16094), True, 'import maya.OpenMaya as om\n'), ((16403, 16458), 'maya.cmds.xform', 'cmds.xform', (['loc'], {'ws': '(1)', 't': '(finalV.x, finalV.y, finalV.z)'}), '(loc, ws=1, t=(finalV.x, finalV.y, finalV.z))\n', (16413, 16458), True, 'import maya.cmds as cmds\n'), ((16473, 16505), 'maya.cmds.group', 'cmds.group', ([], {'em': '(1)', 'n': "(loc + '_grp')"}), "(em=1, n=loc + '_grp')\n", (16483, 16505), True, 'import maya.cmds as cmds\n'), ((16626, 16650), 'maya.cmds.parent', 'cmds.parent', (['loc', 'locGrp'], {}), '(loc, locGrp)\n', (16637, 16650), True, 'import maya.cmds as cmds\n'), ((16655, 16697), 'maya.cmds.makeIdentity', 'cmds.makeIdentity', (['loc'], {'a': '(1)', 't': '(1)', 'r': '(1)', 's': '(1)'}), '(loc, a=1, t=1, r=1, s=1)\n', (16672, 16697), True, 'import maya.cmds as cmds\n'), ((16702, 16738), 'maya.cmds.color', 'cmds.color', (['loc'], {'rgb': 'controllerColor'}), '(loc, rgb=controllerColor)\n', (16712, 16738), True, 'import maya.cmds as cmds\n'), ((16744, 16788), 'maya.cmds.poleVectorConstraint', 'cmds.poleVectorConstraint', (['loc', 'targetHandle'], {}), '(loc, targetHandle)\n', (16769, 16788), True, 'import maya.cmds as cmds\n'), ((17037, 17070), 'maya.cmds.window', 'cmds.window', (['"""switchModeUI"""'], {'ex': '(1)'}), "('switchModeUI', ex=1)\n", (17048, 17070), True, 'import maya.cmds as cmds\n'), ((17116, 17180), 'maya.cmds.window', 'cmds.window', (['"""switchModeUI"""'], {'t': '"""IKFK Builder"""', 'w': '(300)', 'h': '(300)', 's': '(1)'}), "('switchModeUI', t='IKFK Builder', w=300, h=300, s=1)\n", (17127, 17180), True, 'import maya.cmds as cmds\n'), ((17198, 17220), 'maya.cmds.formLayout', 'cmds.formLayout', ([], {'nd': '(50)'}), '(nd=50)\n', (17213, 17220), True, 'import maya.cmds as cmds\n'), ((17297, 17359), 'maya.cmds.optionMenu', 'cmds.optionMenu', (['"""chainMenu_UI"""'], {'l': '"""Which chain?"""', 'cc': 'visCheck'}), "('chainMenu_UI', l='Which chain?', cc=visCheck)\n", (17312, 17359), True, 'import maya.cmds as cmds\n'), ((17364, 17386), 'maya.cmds.menuItem', 'cmds.menuItem', ([], {'l': '"""Leg"""'}), "(l='Leg')\n", (17377, 17386), True, 'import maya.cmds as cmds\n'), ((17391, 17413), 'maya.cmds.menuItem', 'cmds.menuItem', ([], {'l': '"""Arm"""'}), "(l='Arm')\n", (17404, 17413), True, 'import maya.cmds as cmds\n'), ((17813, 17847), 'maya.cmds.checkBox', 'cmds.checkBox', ([], {'l': '"""Clavicle"""', 'vis': '(0)'}), "(l='Clavicle', vis=0)\n", (17826, 17847), True, 'import maya.cmds as cmds\n'), ((17964, 18037), 'maya.cmds.optionMenu', 'cmds.optionMenu', (['"""UI_orientControllerMenu"""'], {'l': '"""What\'s the secondary axis"""'}), '(\'UI_orientControllerMenu\', l="What\'s the secondary axis")\n', (17979, 18037), True, 'import maya.cmds as cmds\n'), ((18042, 18062), 'maya.cmds.menuItem', 'cmds.menuItem', ([], {'l': '"""x"""'}), "(l='x')\n", (18055, 18062), True, 'import maya.cmds as cmds\n'), ((18067, 18087), 'maya.cmds.menuItem', 'cmds.menuItem', ([], {'l': '"""y"""'}), "(l='y')\n", (18080, 18087), True, 'import maya.cmds as cmds\n'), ((18092, 18112), 'maya.cmds.menuItem', 'cmds.menuItem', ([], {'l': '"""z"""'}), "(l='z')\n", (18105, 18112), True, 'import maya.cmds as cmds\n'), ((18184, 18215), 'maya.cmds.text', 'cmds.text', ([], {'l': '"""Controllers size"""'}), "(l='Controllers size')\n", (18193, 18215), True, 'import maya.cmds as cmds\n'), ((18236, 18268), 'maya.cmds.intField', 'cmds.intField', ([], {'en': '(10)', 'v': '(1)', 'min': '(1)'}), '(en=10, v=1, min=1)\n', (18249, 18268), True, 'import maya.cmds as cmds\n'), ((18287, 18320), 'maya.cmds.button', 'cmds.button', ([], {'l': '"""+1"""', 'c': 'addOneUnit'}), "(l='+1', c=addOneUnit)\n", (18298, 18320), True, 'import maya.cmds as cmds\n'), ((18340, 18375), 'maya.cmds.button', 'cmds.button', ([], {'l': '"""+3"""', 'c': 'addThreeUnit'}), "(l='+3', c=addThreeUnit)\n", (18351, 18375), True, 'import maya.cmds as cmds\n'), ((18399, 18418), 'maya.cmds.separator', 'cmds.separator', ([], {'h': '(5)'}), '(h=5)\n', (18413, 18418), True, 'import maya.cmds as cmds\n'), ((18437, 18456), 'maya.cmds.separator', 'cmds.separator', ([], {'h': '(5)'}), '(h=5)\n', (18451, 18456), True, 'import maya.cmds as cmds\n'), ((18577, 19921), 'maya.cmds.formLayout', 'cmds.formLayout', (['mainLayout'], {'e': '(1)', 'attachForm': "[(chainMenu_UI, 'left', 8), (chainMenu_UI, 'top', 5), (chainMenu_UI,\n    'right', 80), (clavCheckbox_UI, 'top', 7), (blendCheckbox_UI, 'left', 5\n    ), (separator01, 'left', 1), (separator01, 'right', 2), (scaleField_UI,\n    'right', 65), (scaleField_UI, 'left', 5), (plusOne_UI, 'right', 5), (\n    plusThree_UI, 'right', 5), (scaleControllerText, 'left', 5), (\n    separator02, 'left', 1), (separator02, 'right', 2), (\n    orientControllerMenu, 'left', 8), (orientControllerMenu, 'top', 5), (\n    execButton, 'bottom', 5), (execButton, 'left', 5), (execButton, 'right', 5)\n    ]", 'attachControl': "[(clavCheckbox_UI, 'left', 10, chainMenu_UI), (constraintCheckBox_UI, 'top',\n    5, chainMenu_UI), (blendCheckbox_UI, 'top', 5, chainMenu_UI), (\n    separator01, 'top', 5, constraintCheckBox_UI), (scaleField_UI, 'top', 5,\n    separator01), (scaleControllerText, 'top', 8, separator01), (plusOne_UI,\n    'top', 4, separator01), (plusThree_UI, 'top', 4, separator01), (\n    separator02, 'top', 6, scaleField_UI), (orientControllerMenu, 'top', 6,\n    separator02)]", 'attachPosition': "[(constraintCheckBox_UI, 'left', 0, 26), (blendCheckbox_UI, 'right', 10, 24\n    ), (scaleControllerText, 'left', 5, 0), (scaleField_UI, 'left', 110, 0),\n    (plusOne_UI, 'right', 0, 45), (plusThree_UI, 'right', 0, 49)]"}), "(mainLayout, e=1, attachForm=[(chainMenu_UI, 'left', 8), (\n    chainMenu_UI, 'top', 5), (chainMenu_UI, 'right', 80), (clavCheckbox_UI,\n    'top', 7), (blendCheckbox_UI, 'left', 5), (separator01, 'left', 1), (\n    separator01, 'right', 2), (scaleField_UI, 'right', 65), (scaleField_UI,\n    'left', 5), (plusOne_UI, 'right', 5), (plusThree_UI, 'right', 5), (\n    scaleControllerText, 'left', 5), (separator02, 'left', 1), (separator02,\n    'right', 2), (orientControllerMenu, 'left', 8), (orientControllerMenu,\n    'top', 5), (execButton, 'bottom', 5), (execButton, 'left', 5), (\n    execButton, 'right', 5)], attachControl=[(clavCheckbox_UI, 'left', 10,\n    chainMenu_UI), (constraintCheckBox_UI, 'top', 5, chainMenu_UI), (\n    blendCheckbox_UI, 'top', 5, chainMenu_UI), (separator01, 'top', 5,\n    constraintCheckBox_UI), (scaleField_UI, 'top', 5, separator01), (\n    scaleControllerText, 'top', 8, separator01), (plusOne_UI, 'top', 4,\n    separator01), (plusThree_UI, 'top', 4, separator01), (separator02,\n    'top', 6, scaleField_UI), (orientControllerMenu, 'top', 6, separator02)\n    ], attachPosition=[(constraintCheckBox_UI, 'left', 0, 26), (\n    blendCheckbox_UI, 'right', 10, 24), (scaleControllerText, 'left', 5, 0),\n    (scaleField_UI, 'left', 110, 0), (plusOne_UI, 'right', 0, 45), (\n    plusThree_UI, 'right', 0, 49)])\n", (18592, 19921), True, 'import maya.cmds as cmds\n'), ((21071, 21093), 'maya.cmds.showWindow', 'cmds.showWindow', (['myWin'], {}), '(myWin)\n', (21086, 21093), True, 'import maya.cmds as cmds\n'), ((343, 373), 'maya.cmds.ls', 'cmds.ls', ([], {'sl': '(True)', 'type': '"""joint"""'}), "(sl=True, type='joint')\n", (350, 373), True, 'import maya.cmds as cmds\n'), ((1797, 1814), 'maya.cmds.select', 'cmds.select', ([], {'cl': '(1)'}), '(cl=1)\n', (1808, 1814), True, 'import maya.cmds as cmds\n'), ((2266, 2315), 'maya.cmds.pointConstraint', 'cmds.pointConstraint', (['switcherLoc', 'switcherLocGrp'], {}), '(switcherLoc, switcherLocGrp)\n', (2286, 2315), True, 'import maya.cmds as cmds\n'), ((2378, 2438), 'maya.cmds.pointConstraint', 'cmds.pointConstraint', (['ogChain[1]', 'ogChain[2]', 'switcherLocGrp'], {}), '(ogChain[1], ogChain[2], switcherLocGrp)\n', (2398, 2438), True, 'import maya.cmds as cmds\n'), ((2742, 2803), 'maya.cmds.setAttr', 'cmds.setAttr', (["(switcherLoc[0] + '.translate' + coord)"], {'k': '(0)', 'l': '(1)'}), "(switcherLoc[0] + '.translate' + coord, k=0, l=1)\n", (2754, 2803), True, 'import maya.cmds as cmds\n'), ((2812, 2870), 'maya.cmds.setAttr', 'cmds.setAttr', (["(switcherLoc[0] + '.rotate' + coord)"], {'k': '(0)', 'l': '(1)'}), "(switcherLoc[0] + '.rotate' + coord, k=0, l=1)\n", (2824, 2870), True, 'import maya.cmds as cmds\n'), ((2879, 2936), 'maya.cmds.setAttr', 'cmds.setAttr', (["(switcherLoc[0] + '.scale' + coord)"], {'k': '(0)', 'l': '(1)'}), "(switcherLoc[0] + '.scale' + coord, k=0, l=1)\n", (2891, 2936), True, 'import maya.cmds as cmds\n'), ((3178, 3219), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (['ogChain[0]', 'rigGrp'], {}), '(ogChain[0], rigGrp)\n', (3199, 3219), True, 'import maya.cmds as cmds\n'), ((3237, 3279), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (['ogChain[0]', 'ctrlGrp'], {}), '(ogChain[0], ctrlGrp)\n', (3258, 3279), True, 'import maya.cmds as cmds\n'), ((3572, 3632), 'maya.cmds.parent', 'cmds.parent', (["(ogChain[0] + '_ik')", "(ogChain[0] + '_fk')", 'ctrlGrp'], {}), "(ogChain[0] + '_ik', ogChain[0] + '_fk', ctrlGrp)\n", (3583, 3632), True, 'import maya.cmds as cmds\n'), ((3641, 3690), 'maya.cmds.parent', 'cmds.parent', (["(ogChain[0] + '_fk_anim_grp')", 'ctrlGrp'], {}), "(ogChain[0] + '_fk_anim_grp', ctrlGrp)\n", (3652, 3690), True, 'import maya.cmds as cmds\n'), ((3699, 3734), 'maya.cmds.parent', 'cmds.parent', (['switcherLocGrp', 'rigGrp'], {}), '(switcherLocGrp, rigGrp)\n', (3710, 3734), True, 'import maya.cmds as cmds\n'), ((3855, 3888), 'maya.cmds.pickWalk', 'cmds.pickWalk', (['ogChain[0]'], {'d': '"""up"""'}), "(ogChain[0], d='up')\n", (3868, 3888), True, 'import maya.cmds as cmds\n'), ((4034, 4081), 'maya.cmds.pointConstraint', 'cmds.pointConstraint', (['clavJoint', 'clavController'], {}), '(clavJoint, clavController)\n', (4054, 4081), True, 'import maya.cmds as cmds\n'), ((4212, 4263), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (['clavJoint', 'clavControllerGrp'], {}), '(clavJoint, clavControllerGrp)\n', (4233, 4263), True, 'import maya.cmds as cmds\n'), ((5617, 5672), 'maya.cmds.createNode', 'cmds.createNode', (['"""blendColors"""'], {'n': "(ogChain[x] + '_blend')"}), "('blendColors', n=ogChain[x] + '_blend')\n", (5632, 5672), True, 'import maya.cmds as cmds\n'), ((5801, 5873), 'maya.cmds.connectAttr', 'cmds.connectAttr', (["(ogChain[x] + '_ik.rotate')", "(blendColorsNode + '.color1')"], {}), "(ogChain[x] + '_ik.rotate', blendColorsNode + '.color1')\n", (5817, 5873), True, 'import maya.cmds as cmds\n'), ((5884, 5956), 'maya.cmds.connectAttr', 'cmds.connectAttr', (["(ogChain[x] + '_fk.rotate')", "(blendColorsNode + '.color2')"], {}), "(ogChain[x] + '_fk.rotate', blendColorsNode + '.color2')\n", (5900, 5956), True, 'import maya.cmds as cmds\n'), ((5967, 6036), 'maya.cmds.connectAttr', 'cmds.connectAttr', (["(blendColorsNode + '.output')", "(ogChain[x] + '.rotate')"], {}), "(blendColorsNode + '.output', ogChain[x] + '.rotate')\n", (5983, 6036), True, 'import maya.cmds as cmds\n'), ((6050, 6127), 'maya.cmds.connectAttr', 'cmds.connectAttr', (["(switcherLoc[0] + '.FKIK_Mode')", "(blendColorsNode + '.blender')"], {}), "(switcherLoc[0] + '.FKIK_Mode', blendColorsNode + '.blender')\n", (6066, 6127), True, 'import maya.cmds as cmds\n'), ((6438, 6491), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (["(ogChain[x] + '_ik')", 'ogChain[x]'], {}), "(ogChain[x] + '_ik', ogChain[x])\n", (6459, 6491), True, 'import maya.cmds as cmds\n'), ((6502, 6555), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (["(ogChain[x] + '_fk')", 'ogChain[x]'], {}), "(ogChain[x] + '_fk', ogChain[x])\n", (6523, 6555), True, 'import maya.cmds as cmds\n'), ((6836, 6862), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(0)'], {}), '(sdkDriver, 0)\n', (6848, 6862), True, 'import maya.cmds as cmds\n'), ((6871, 6931), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (['ikSdkDriven'], {'cd': 'sdkDriver', 'v': '(0)', 'dv': '(0)'}), '(ikSdkDriven, cd=sdkDriver, v=0, dv=0)\n', (6893, 6931), True, 'import maya.cmds as cmds\n'), ((6940, 7000), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (['fkSdkDriven'], {'cd': 'sdkDriver', 'v': '(1)', 'dv': '(0)'}), '(fkSdkDriven, cd=sdkDriver, v=1, dv=0)\n', (6962, 7000), True, 'import maya.cmds as cmds\n'), ((7010, 7036), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(1)'], {}), '(sdkDriver, 1)\n', (7022, 7036), True, 'import maya.cmds as cmds\n'), ((7045, 7105), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (['ikSdkDriven'], {'cd': 'sdkDriver', 'v': '(1)', 'dv': '(1)'}), '(ikSdkDriven, cd=sdkDriver, v=1, dv=1)\n', (7067, 7105), True, 'import maya.cmds as cmds\n'), ((7114, 7174), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (['fkSdkDriven'], {'cd': 'sdkDriver', 'v': '(0)', 'dv': '(1)'}), '(fkSdkDriven, cd=sdkDriver, v=0, dv=1)\n', (7136, 7174), True, 'import maya.cmds as cmds\n'), ((7536, 7583), 'maya.cmds.group', 'cmds.group', ([], {'em': '(1)', 'n': "(ogChain[y] + '_fk_anim_grp')"}), "(em=1, n=ogChain[y] + '_fk_anim_grp')\n", (7546, 7583), True, 'import maya.cmds as cmds\n'), ((7742, 7791), 'maya.cmds.scale', 'cmds.scale', (['fkSize', 'fkSize', 'fkSize', 'fk_controller'], {}), '(fkSize, fkSize, fkSize, fk_controller)\n', (7752, 7791), True, 'import maya.cmds as cmds\n'), ((7813, 7856), 'maya.cmds.matchTransform', 'cmds.matchTransform', (['anim_group', 'ogChain[y]'], {}), '(anim_group, ogChain[y])\n', (7832, 7856), True, 'import maya.cmds as cmds\n'), ((7935, 7973), 'maya.cmds.parent', 'cmds.parent', (['fk_controller', 'anim_group'], {}), '(fk_controller, anim_group)\n', (7946, 7973), True, 'import maya.cmds as cmds\n'), ((8321, 8373), 'maya.cmds.makeIdentity', 'cmds.makeIdentity', (['fk_controller'], {'a': '(1)', 't': '(1)', 'r': '(1)', 's': '(0)'}), '(fk_controller, a=1, t=1, r=1, s=0)\n', (8338, 8373), True, 'import maya.cmds as cmds\n'), ((8390, 8422), 'maya.cmds.delete', 'cmds.delete', (['fk_controller'], {'ch': '(1)'}), '(fk_controller, ch=1)\n', (8401, 8422), True, 'import maya.cmds as cmds\n'), ((8433, 8479), 'maya.cmds.color', 'cmds.color', (['fk_controller'], {'rgb': 'controllerColor'}), '(fk_controller, rgb=controllerColor)\n', (8443, 8479), True, 'import maya.cmds as cmds\n'), ((8576, 8602), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(1)'], {}), '(sdkDriver, 1)\n', (8588, 8602), True, 'import maya.cmds as cmds\n'), ((8611, 8702), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(ogChain[0] + '_fk_anim_grp.visibility')"], {'cd': 'sdkDriver', 'v': '(1)', 'dv': '(0)'}), "(ogChain[0] + '_fk_anim_grp.visibility', cd=sdkDriver,\n    v=1, dv=0)\n", (8633, 8702), True, 'import maya.cmds as cmds\n'), ((8707, 8733), 'maya.cmds.setAttr', 'cmds.setAttr', (['sdkDriver', '(0)'], {}), '(sdkDriver, 0)\n', (8719, 8733), True, 'import maya.cmds as cmds\n'), ((8742, 8833), 'maya.cmds.setDrivenKeyframe', 'cmds.setDrivenKeyframe', (["(ogChain[0] + '_fk_anim_grp.visibility')"], {'cd': 'sdkDriver', 'v': '(0)', 'dv': '(1)'}), "(ogChain[0] + '_fk_anim_grp.visibility', cd=sdkDriver,\n    v=0, dv=1)\n", (8764, 8833), True, 'import maya.cmds as cmds\n'), ((9158, 9227), 'maya.cmds.parent', 'cmds.parent', (["(ogChain[x] + '_fk_anim_grp')", "(ogChain[x - 1] + '_fk_anim')"], {}), "(ogChain[x] + '_fk_anim_grp', ogChain[x - 1] + '_fk_anim')\n", (9169, 9227), True, 'import maya.cmds as cmds\n'), ((9329, 9395), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (["(ogChain[x] + '_fk_anim')", "(ogChain[x] + '_fk')"], {}), "(ogChain[x] + '_fk_anim', ogChain[x] + '_fk')\n", (9350, 9395), True, 'import maya.cmds as cmds\n'), ((10189, 10243), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (["(ogChain[2] + '_ik')", 'ikHandJoint'], {}), "(ogChain[2] + '_ik', ikHandJoint)\n", (10210, 10243), True, 'import maya.cmds as cmds\n'), ((10337, 10380), 'maya.cmds.move', 'cmds.move', (['(10)', '(0)', '(0)', 'ikHandJoint'], {'r': '(1)', 'os': '(1)'}), '(10, 0, 0, ikHandJoint, r=1, os=1)\n', (10346, 10380), True, 'import maya.cmds as cmds\n'), ((10397, 10441), 'maya.cmds.move', 'cmds.move', (['(-10)', '(0)', '(0)', 'ikHandJoint'], {'r': '(1)', 'os': '(1)'}), '(-10, 0, 0, ikHandJoint, r=1, os=1)\n', (10406, 10441), True, 'import maya.cmds as cmds\n'), ((11517, 11572), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (["(ogChain[2] + '_ik')", 'crvIkCubeGrp'], {}), "(ogChain[2] + '_ik', crvIkCubeGrp)\n", (11538, 11572), True, 'import maya.cmds as cmds\n'), ((13873, 13931), 'maya.cmds.pointConstraint', 'cmds.pointConstraint', (["(ogChain[3] + '_ik')", 'ikFootControlGrp'], {}), "(ogChain[3] + '_ik', ikFootControlGrp)\n", (13893, 13931), True, 'import maya.cmds as cmds\n'), ((14891, 14967), 'maya.cmds.addAttr', 'cmds.addAttr', (['ikFootControl'], {'at': '"""enum"""', 'enumName': '"""------"""', 'ln': 'bone', 'k': '(1)', 'r': '(1)'}), "(ikFootControl, at='enum', enumName='------', ln=bone, k=1, r=1)\n", (14903, 14967), True, 'import maya.cmds as cmds\n'), ((16587, 16620), 'maya.cmds.pointConstraint', 'cmds.pointConstraint', (['loc', 'locGrp'], {}), '(loc, locGrp)\n', (16607, 16620), True, 'import maya.cmds as cmds\n'), ((17074, 17103), 'maya.cmds.deleteUI', 'cmds.deleteUI', (['"""switchModeUI"""'], {}), "('switchModeUI')\n", (17087, 17103), True, 'import maya.cmds as cmds\n'), ((1565, 1591), 'maya.cmds.joint', 'cmds.joint', ([], {'n': 'newJointName'}), '(n=newJointName)\n', (1575, 1591), True, 'import maya.cmds as cmds\n'), ((1606, 1651), 'maya.cmds.matchTransform', 'cmds.matchTransform', (['newJointName', 'ogChain[i]'], {}), '(newJointName, ogChain[i])\n', (1625, 1651), True, 'import maya.cmds as cmds\n'), ((1664, 1715), 'maya.cmds.makeIdentity', 'cmds.makeIdentity', (['newJointName'], {'a': '(1)', 't': '(0)', 'r': '(1)', 's': '(0)'}), '(newJointName, a=1, t=0, r=1, s=0)\n', (1681, 1715), True, 'import maya.cmds as cmds\n'), ((7608, 7646), 'maya.cmds.circle', 'cmds.circle', ([], {'n': "(ogChain[y] + '_fk_anim')"}), "(n=ogChain[y] + '_fk_anim')\n", (7619, 7646), True, 'import maya.cmds as cmds\n'), ((7877, 7925), 'maya.cmds.parentConstraint', 'cmds.parentConstraint', (['ogChain[y]', 'fk_controller'], {}), '(ogChain[y], fk_controller)\n', (7898, 7925), True, 'import maya.cmds as cmds\n'), ((8070, 8106), 'maya.cmds.rotate', 'cmds.rotate', (['(90)', '(0)', '(0)', 'fk_controller'], {}), '(90, 0, 0, fk_controller)\n', (8081, 8106), True, 'import maya.cmds as cmds\n'), ((8141, 8177), 'maya.cmds.rotate', 'cmds.rotate', (['(0)', '(90)', '(0)', 'fk_controller'], {}), '(0, 90, 0, fk_controller)\n', (8152, 8177), True, 'import maya.cmds as cmds\n'), ((8212, 8248), 'maya.cmds.rotate', 'cmds.rotate', (['(0)', '(0)', '(90)', 'fk_controller'], {}), '(0, 0, 90, fk_controller)\n', (8223, 8248), True, 'import maya.cmds as cmds\n'), ((15020, 15074), 'maya.cmds.addAttr', 'cmds.addAttr', (['ikFootControl'], {'ln': '(bone + coord)', 'k': '(1)', 'r': '(1)'}), '(ikFootControl, ln=bone + coord, k=1, r=1)\n', (15032, 15074), True, 'import maya.cmds as cmds\n'), ((18516, 18570), 'functools.partial', 'partial', (['duplicateChain', 'blendNodeFunc', 'constraintFunc'], {}), '(duplicateChain, blendNodeFunc, constraintFunc)\n', (18523, 18570), False, 'from functools import partial\n'), ((1366, 1409), 'maya.cmds.error', 'cmds.error', (['"""pls, select one relation type"""'], {}), "('pls, select one relation type')\n", (1376, 1409), True, 'import maya.cmds as cmds\n'), ((9543, 9594), 'maya.cmds.delete', 'cmds.delete', (["(ogChain[chainLen - 1] + '_fk_anim_grp')"], {}), "(ogChain[chainLen - 1] + '_fk_anim_grp')\n", (9554, 9594), True, 'import maya.cmds as cmds\n'), ((17557, 17607), 'maya.cmds.checkBox', 'cmds.checkBox', (['blendCheckbox_UI'], {'e': '(1)', 'en': '(state - 1)'}), '(blendCheckbox_UI, e=1, en=state - 1)\n', (17570, 17607), True, 'import maya.cmds as cmds\n'), ((17734, 17789), 'maya.cmds.checkBox', 'cmds.checkBox', (['constraintCheckBox_UI'], {'e': '(1)', 'en': '(state - 1)'}), '(constraintCheckBox_UI, e=1, en=state - 1)\n', (17747, 17789), True, 'import maya.cmds as cmds\n')]