コード例 #1
0
ファイル: rig.py プロジェクト: jonntd/japeto
    def saveControls(cls, controls, filepath):
        """
        Save the controls for the asset
        
        :param controls: controls that will be written out 
                        if they're nurbsCurves
        :type controls: list | str | tuple
        """
        # declare list that will be used to gather controls to save
        savedControls = list()
        # make sure controls is a list before proceeding
        controls = common.toList(controls)

        if not isinstance(controls, list):
            raise RuntimeError("%s must be a list" % controls)
        # end if

        for ctrl in controls:
            if common.isValid(ctrl):
                if common.isType(ctrl, "nurbsCurve") or common.isType(common.getShapes(ctrl, 0), "nurbsCurve"):
                    savedControls.append(ctrl)
            # end if
        # end loop

        # save the controls in savedControls list
        control.save(savedControls, filepath=filepath)
コード例 #2
0
ファイル: component.py プロジェクト: jonntd/japeto
    def postSetupRig(self):
        '''
        clean up section for the setup rig
        '''
        if common.isValid('%s.displayAxis' % self.masterGuide) or common.isValid(self.masterGuide) != True:
            return True
        #create attributes and lock/hide attrs on top nodes as well as masterGuide control
        displayAttr = attribute.addAttr(self.masterGuide, 'displayAxis', attrType = 'enum', defValue = 'off:on')
        attribute.lockAndHide(['r','t','s','v'], [self.setupRigGrp, self.skeletonGrp,self.guidesGrp, common.getParent(self.masterGuide)])
        attribute.lockAndHide('v', self.masterGuide)
        
        #resize guide controls
        for guide in self.getGuides():
            cmds.setAttr('%s.radius' % common.getShapes(guide, 0), self.controlScale * .5)
        
        #resize masterGuide control
        control.scaleShape(self.masterGuide, scale = [self.controlScale * 2, self.controlScale * 2, self.controlScale * 2])
        
        #declaring skeleton joints
        skeletonJnts = self.getSkeletonJnts()
        
        #connect joints to the attributes on the masterGuide control
        for jnt in skeletonJnts:
            if cmds.objExists(jnt):
                attribute.connect(displayAttr , '%s.displayLocalAxis' % jnt)
                common.setDisplayType(jnt, 'reference')

        #parent all constraints to guides group
        if self.setupConstraints:
            cmds.parent(self.setupConstraints, self.guidesGrp)

        #Put the build attributes onto setup rigs
        '''
        cmds.addAttr(self.setupRigGrp, ln = 'kwargs', dt = "string")
        cmds.setAttr('%s.kwargs' % self.setupRigGrp, str(self._buildAttrs), type = "string")
        '''
        attribute.copy('displayAxis', self.masterGuide, self.name(), reverseConnect = True)
        
        #parent setup under puppet node
        self._puppetNode.addChild(self.setupRigGrp)
        
        if self.parentHook:
            if cmds.objExists(self.parentHook):
                displayLine = control.displayLine(self.masterGuide, self.parentHook, name = self.masterGuide.replace('_%s' % common.GUIDES, '_%s' % common.CURVE))
                cmds.parent(displayLine, self.guidesGrp)

        #set build args on puppet node
        attrs = dict()
        for attr in self.attributes():
            attrs[attr.name()] = attr.value()
        self.puppetNode.storeArgs(**attrs)
コード例 #3
0
ファイル: spine.py プロジェクト: jonntd/japeto
 def _ikControlSetup(self, drivers):
     '''
     Takes driver joints that drive the IK spine and create controls for them
     
     @param drivers: list of drivers you want to put controls on
     @type drivers: *list* or *tuple* or *str* 
     
     @return: IK controls which were created to drive the driver joints passed in
     @rtype: *list*
     '''
     #create an empty list to store ik controls in so we can return them
     ikControls = list()
     
     drivers = common.toList(drivers)
     
     for i,driver in enumerate(drivers):
         nameDescription = common.getDescription(driver)
         ctrlName = '%s_%s_%s' % (self._getSide(),nameDescription,common.IK)
         ctrl = control.create(ctrlName, type = 'cube',
                               parent = self.controlsGrp,
                               color = common.SIDE_COLOR[self._getSide()])
         ctrlZero = common.getParent(ctrl)
         #driverParent = common.getParent(driver)
         #move control in to position of driver jnt
         transform.matchXform(driver, ctrlZero, 'pose')
         #cmds.parent(ctrlZero, driverParent)
         #cmds.parent(driver, ctrl)
         cmds.parentConstraint(ctrl, driver,mo = True)
         
         
         #connect ik/fk attr from group to  visibility of shapes
         reverse = cmds.createNode('reverse', n = '%s_%s_%s' % (self.name(),
                                                             common.IK,
                                                             common.REVERSE
                                                             ))
         attribute.connect('%s.ikfk' % self.ikFkGroup,'%s.inputX' % reverse)
         for shape in common.getShapes(ctrl):
             if self.ikFkGroup:
                 attribute.connect('%s.outputX' % reverse,
                                   '%s.v' % shape)
             #end if
         #end loop
         
         ikControls.append(ctrl)
         
         
         
     #end loop
         
     return ikControls
     
コード例 #4
0
ファイル: chain.py プロジェクト: jonntd/japeto
    def _fkControlSetup(self, joints):
        '''
        Creates FK control setup on the input joints
        
        Example:
            ...python:
                    self._fkControlSetup(["jnt1", "jnt2", "jnt3"])
                    #Return: ["ctrl1", "ctrl2", "ctrl3"]
                    
        :param joints: Joints to have controls drive
        :type joints: *list* or *tupple* or *str*
        
        
        '''
        joints = common.toList(joints)
        
        if not isinstance(joints, list) and not isinstance(joints, tuple):
            raise RuntimeError('%s must be a *list* or *tuple*' % joints)
        
        fkCtrls = list()
        parent = self.controlsGrp

        for jnt in joints:            
            ctrl = control.create(name= jnt.split('_%s' % common.JOINT)[0],
                    type = 'circle',
                    parent = parent,
                    color = common.SIDE_COLOR[self._getSide()])

            ctrlParent = common.getParent(ctrl)
            transform.matchXform(jnt, ctrlParent, type = 'pose')
            cmds.parentConstraint(ctrl, jnt, mo = True) #----> might change this to connect rotations and not use translation
            
            #connect visibility of shapes to foot control
            for shape in common.getShapes(ctrl):
                if self.ikFkGroup:
                    attribute.connect('%s.ikfk' % self.ikFkGroup,
                                      '%s.v' % shape)
                #end if
            #end loop

            parent = ctrl
            fkCtrls.append(ctrl)
        #end loop
            
        return fkCtrls
コード例 #5
0
ファイル: hand.py プロジェクト: jonntd/japeto
 def rig(self):
     if not self._puppetNode:
         self.runSetupRig()
     #TODO: Place build code for fingers here
     for obj in self.fingers:
         self.__fingers[obj].rig()
     
     if super(Hand, self).rig():
         return True
     
     #TODO: Put build code here
     control.create(self.handCtrl.replace('_%s' % common.CONTROL, ''),
                    type = 'implicitSphere',
                    parent = self.controlsGrp,
                    color = common.SIDE_COLOR[self._getSide()])
     
     for i in range(len(common.getShapes(self.handCtrl))):
         control.scaleShape (self.handCtrl,scale = [.3,.3,.3],index = i)
     #end loop
     handCtrlZero = common.getParent(self.handCtrl)
     transform.matchXform(self.handJoint,handCtrlZero, 'pose')
     #cmds.xform(handCtrlZero, ws = True, t = self.handPosition)
     cmds.xform(handCtrlZero, ws = True, r = True, t = [0,1,0])
コード例 #6
0
ファイル: limb.py プロジェクト: jonntd/japeto
    def rig(self):
        if not self._puppetNode:
            self.runSetupRig()
        if cmds.objExists('%s.master_guide' % self.setupRigGrp):
            self.masterGuide = attribute.getConnections('master_guide', self.setupRigGrp)[0].split('.')[0]
        if common.isValid(self.masterGuide):
            #get orientations for controls
            fkOrient  = self.__fkOrient()
            ikOrient  = self.__ikOrient()
            upVector  = self.upVector
            aimVector = self.aimVector

        #call parent class rig function
        if super(Limb, self).rig():
            return True
        
        #create ik fk switch
        ikfkDict = ikfk.create(jointChain = [self.startJoint, self.midJoint, self.tipJoint], stretch = self.stretch)
        ikfkDict['group'] = cmds.rename(ikfkDict['group'], '%s_%s' % (self.name(),ikfkDict['group']))

        #set the visibility on the ik/fk/blend joints to off
        cmds.setAttr('%s.v' % ikfkDict['fkJoints'][0], 0)
        cmds.setAttr('%s.v' % ikfkDict['ikJoints'][0], 0)
        cmds.setAttr('%s.v' % ikfkDict['blendJoints'][0], 0)

        ikfkAttr = attribute.addAttr(self.rigGrp, attr = 'ikfk', attrType = 'enum', defValue = ['off','on'],value = 0)

        cmds.connectAttr(ikfkAttr, '%s.ikfk' % ikfkDict['group'], l = True, f = True)

        #parent ikfk group under joints group
        cmds.parent(ikfkDict['group'], self.jointsGrp)

        #rename all ik and blend joints
        for i,jnt in enumerate(ikfkDict['ikJoints']):
            jnt = cmds.rename(jnt, jnt.replace('%s_%s_%s' % (common.SKINCLUSTER,common.JOINT, common.IK), '%s_%s' % (common.IK, common.JOINT)))
            ikfkDict['ikJoints'][i] = jnt

        for i,jnt in enumerate(ikfkDict['blendJoints']):
            jnt = cmds.rename(jnt, jnt.replace('%s_%s_%s' % (common.SKINCLUSTER,common.JOINT, common.BLEND), '%s_%s' % (common.BLEND, common.JOINT)))
            ikfkDict['blendJoints'][i] = jnt

        #create ik setup
        ikCtrl = control.create(name = ikfkDict['ikJoints'][2].replace('_%s' % common.JOINT, ''),type = 'cube', parent = self.controlsGrp, color = common.SIDE_COLOR[self._getSide()])
        ikCtrlZero = common.getParent(ikCtrl)
        attribute.copy('stretch', ikfkDict['group'], destination = ikCtrl, connect = True,reverseConnect = False)
        attribute.copy('stretchTop', ikfkDict['group'], destination = ikCtrl, connect = True,reverseConnect = False)
        attribute.copy('stretchBottom', ikfkDict['group'], destination = ikCtrl, connect = True,reverseConnect = False)

        if ikOrient == 'Local':
            transform.matchXform(ikfkDict['ikJoints'][2], ikCtrlZero, type = 'pose')
        else:
            transform.matchXform(ikfkDict['ikJoints'][2], ikCtrlZero, type = 'position')
            cmds.orientConstraint(ikCtrl, ikfkDict['ikJoints'][2], mo = True)
            common.setColor(ikCtrl, common.SIDE_COLOR[self._getSide()])

            #setup poleVector
            pvCtrl = control.create(name = ikfkDict['ikJoints'][2].replace('_%s' % common.JOINT, '_%s' % common.POLEVECTOR),type = 'cube', parent = self.controlsGrp, color = common.SIDE_COLOR[self._getSide()])
            #size polevector control

        for i in range(len(common.getShapes(pvCtrl))):
            control.scaleShape(pvCtrl, scale = [self.controlScale * .5, self.controlScale * .5, self.controlScale * .5], index = i)

        pvCtrlZero = common.getParent(pvCtrl)
        pvDisplayLineAttr = attribute.addAttr(pvCtrl, attr = 'pvLine', attrType = 'enum', defValue = 'off:on', value = 1)
        transform.matchXform(ikfkDict['ikJoints'][1], pvCtrlZero, type = 'position')
        #cmds.parent(ikfkDict['ikHandle'], w = True)
        pvPos = ikfk.getPoleVectorPosition(ikfkDict['ikJoints'][1], ikfkDict['ikHandle'])
        cmds.xform(pvCtrlZero, ws = True, t = pvPos)
        common.setColor(pvCtrlZero, common.SIDE_COLOR[self._getSide()])

        #create polevector constraint and parent under control
        cmds.poleVectorConstraint(pvCtrl, ikfkDict['ikHandle'])
        targetConstraint = cmds.pointConstraint(ikCtrl, ikfkDict['targetJnts'][1], mo = True) #ikhandle is under target joint
        pvDisplayLine = control.displayLine(ikfkDict['ikJoints'][0], pvCtrl, name = pvCtrl.replace(common.CONTROL, common.DISPLAYLINE), parent = self.controlsGrp)


        cmds.orientConstraint(ikCtrl,ikfkDict['ikJoints'][0], mo = True)

        #adding attribute to ik ctrl
        ikTwistAttr = attribute.addAttr(ikCtrl, attr = 'twist')
        cmds.connectAttr(ikTwistAttr, '%s.twist' % ikfkDict['ikHandle'], f = True)

        #connecting to shapes
        ikfkReverse = cmds.createNode('reverse', n = ikCtrl.replace('%s_%s' % (common.IK, common.CONTROL), '%s_%s' % (common.REVERSE, common.UTILITY)))
        attribute.connect('%s.ikfk' % ikfkDict['group'], '%s.inputX' % ikfkReverse)
        for shape in common.getShapes(ikCtrl):
            attribute.connect('%s.outputX' % ikfkReverse,'%s.v' % shape)

        for shape in common.getShapes(pvCtrl):
            attribute.connect('%s.outputX' % ikfkReverse,'%s.v' % shape)

        #connect pvDisplayLineAttr in pvDisplayLine visibility
        displayLineMultiply = cmds.createNode('multiplyDivide', n = pvDisplayLine.replace(common.DISPLAYLINE, common.MULTIPLYDIVIDE))
        attribute.connect(pvDisplayLineAttr, '%s.input1X' % displayLineMultiply)
        attribute.connect('%s.outputX' % ikfkReverse, '%s.input2X' % displayLineMultiply)
        attribute.connect('%s.outputX' % displayLineMultiply, '%s.v' % common.getChildren(pvDisplayLine)[0])

        #create fk setup
        fkCtrls = list()
        parent = self.controlsGrp
        for i,jnt in enumerate(ikfkDict['fkJoints']):
            cmds.select(cl = True)
            #rename fk joint
            jnt = cmds.rename(jnt,jnt.replace('%s_%s_%s' % (common.SKINCLUSTER,common.JOINT,common.FK), '%s_%s' % (common.FK,common.JOINT)))
            ikfkDict['fkJoints'][i] = jnt #re-assign fk joint intop ikfkDict
            #create controls, set color, and make connections
            fkCtrl = control.create(name = jnt.replace('_%s' % common.JOINT, ''),type = 'circle', parent = parent, color = common.SIDE_COLOR[self._getSide()])
            fkCtrlZero = common.getParent(fkCtrl)
            
            if fkOrient == 'Local':
                transform.matchXform(jnt, fkCtrlZero, type = 'pose')
            #end if
            else:
                transform.matchXform(jnt, fkCtrlZero, type = 'position')
            #end else
            
            cmds.connectAttr('%s.ikfk' % ikfkDict['group'], '%s.v' % common.getShapes(fkCtrl)[0], f = True)
            cmds.parentConstraint(fkCtrl, jnt, mo = True)
            attribute.lockAndHide('t', fkCtrl)
            attribute.lockAndHide('s', fkCtrl)
            attribute.lockAndHide('v', fkCtrl)
            #get joint rotate order and apply to control and parent group
            rotateOrder = attribute.getValue('rotateOrder', jnt)
            for node in [fkCtrl, fkCtrlZero]:
                cmds.setAttr('%s.rotateOrder' % node, rotateOrder)
    
                fkCtrls.append(fkCtrl)
                parent = fkCtrl
            #end loop
        #end loop

        aimAxis = transform.getAimAxis(ikfkDict['blendJoints'][0], allowNegative = False)    
        #Up Twist Joint Setup
        if self.upTwistJnts:
            noTwistJnt = common.duplicate(self.startJoint, name = self.startJoint.replace('%s' % common.SKINCLUSTER, 'NoTwist_%s' % common.SKINCLUSTER), parent = self.startJoint)

            inverseMultNode = cmds.createNode('multiplyDivide', n = noTwistJnt.replace('%s_%s' % (common.SKINCLUSTER,common.JOINT), '%s_%s' % (common.UTILITY, common.MULTIPLYDIVIDE)))
            cmds.connectAttr('%s.r%s' % (ikfkDict['blendJoints'][0], aimAxis), '%s.input1X' % inverseMultNode, f = True)
            cmds.setAttr('%s.input2X' % inverseMultNode, -1)
            cmds.connectAttr('%s.outputX' % inverseMultNode, '%s.r%s' % (noTwistJnt, aimAxis), f = True)


            step   = 1.0 / (len(self.upTwistJnts) +1)
            for i in range( 1, (len(self.upTwistJnts)+1) ):
                twsitMultNode = cmds.createNode('multiplyDivide', n = self.upTwistJnts[i - 1].replace('%s_%s' % (common.SKINCLUSTER,common.JOINT), '%s_%s' % (common.UTILITY, common.MULTIPLYDIVIDE)))
                cmds.connectAttr('%s.r%s' % (ikfkDict['blendJoints'][0], aimAxis), '%s.input1X' % twsitMultNode, f = True)
                cmds.setAttr('%s.input2X' % twsitMultNode, -(1-(step*i))  )
                cmds.connectAttr('%s.outputX' % twsitMultNode, '%s.r%s' % (self.upTwistJnts[i -1], aimAxis),f = True)
            #end loop

            self.upTwistJnts.insert(0, noTwistJnt)
        #end if

        if self.loTwistJnts:
            twistJnt = common.duplicate(self.midJoint,name = self.midJoint.replace('%s' % common.SKINCLUSTER, 'loTwist_%s' % common.SKINCLUSTER), parent = self.midJoint)
            constraint = cmds.aimConstraint(ikfkDict['blendJoints'][2],twistJnt,aimVector =  aimVector, upVector  = upVector,  worldUpType ="objectrotation", worldUpVector = upVector, worldUpObject = self.tipJoint)
            cmds.setAttr('%s.v' % twistJnt, 0)
        #end if

        step   = 1.0 / (len(self.loTwistJnts) +1)
        for i in range( 1, (len(self.loTwistJnts)+1) ):
            twsitMultNode = cmds.createNode('multiplyDivide', n = self.loTwistJnts[i - 1].replace('%s_%s' % (common.SKINCLUSTER,common.JOINT), '%s_%s' % (common.UTILITY, common.MULTIPLYDIVIDE)))
            cmds.connectAttr('%s.r%s' % (ikfkDict['blendJoints'][2], aimAxis), '%s.input1X' % twsitMultNode, f = True)
            cmds.setAttr('%s.input2X' % twsitMultNode, 1-(step*i) )
            cmds.connectAttr('%s.outputX' % twsitMultNode, '%s.r%s' % (self.loTwistJnts[i -1], aimAxis),f = True)
        #end loop

        #------------------------
        #Add to class variables
        #------------------------
        #assign joints to the joints list
        self.joints = {'ik' : ikfkDict['ikJoints'], 'fk' : ikfkDict['fkJoints'], 'blend' : ikfkDict['blendJoints'], 'target' : ikfkDict['targetJnts']}
        #assign controls to the controls list
        #assign fkCtrls into the controls dictionary 
        self.controls = {'ik' : [ikCtrl, pvCtrl],'fk' : fkCtrls }
        self.ikfkGroup = ikfkDict['group']
        #assign hooks
        self.hookRoot = [ikfkDict['ikJoints'][0], common.getParent(fkCtrls[0]), ikCtrl, ikfkDict['targetJnts'][-1]]
        self.hookPoint = [ikfkDict['blendJoints'][-1]]
        #add no twist joint to the skincluster list
        self.skinClusterJnts.append(noTwistJnt)
コード例 #7
0
ファイル: foot.py プロジェクト: jonntd/japeto
    def setupRig(self):
        if super(Foot, self).setupRig():
            return True

        self.skinClusterJnts = [ self.ankleJoint,
                                 self.ballJoint,
                                 self.toeJoint ]

        if self._getSide() == common.LEFT:
            positions = (
            [self.position[0] + 2, self.position[1] + 2, self.position[2]],
            [self.position[0] + 2, self.position[1], self.position[2] + 2],
            [self.position[0] + 2, self.position[1], self.position[2] + 4]
            )

            #create offset position depending on which side it's on
            bankInOffset = -1
            bankOutOffset = 1
        elif self._getSide() == common.RIGHT:
            positions = (
            [self.position[0] - 2, self.position[1] + 2, self.position[2]],
            [self.position[0] - 2, self.position[1], self.position[2] + 2],
            [self.position[0] - 2, self.position[1], self.position[2] + 4]
            )

            #create offset position depending on which side it's on
            bankInOffset = 1
            bankOutOffset = -1
        else:
            positions = (
            [self.position[0], self.position[1] + 2, self.position[2]],
            [self.position[0], self.position[1], self.position[2] + 2],
            [self.position[0], self.position[1], self.position[2] + 4]
            )

            #create offset position depending on which side it's on
            bankInOffset = -1
            bankOutOffset = 1
        #end elif

        for i,jnt in enumerate(self.skinClusterJnts):
            cmds.joint(n = jnt,position = positions[i])

            if i == 0:
                cmds.parent(jnt, self.skeletonGrp)
                #place Master Guide control in the same position as the first joint
                transform.matchXform(jnt,
                    common.getParent(self.masterGuide),
                    type = 'position')
            else:
                cmds.parent(jnt, self.skinClusterJnts[i - 1])
            #end else

            ctrl = self.setupCtrl(jnt.replace('_%s' % common.JOINT, ''),jnt)
            #create template control
            #control.createTemplate(ctrl)
            cmds.select(cl = True)
        #end loop

        #create pivots for setup
        self.__bankInPivot = cmds.createNode('joint',
                n = '%s_bankIn_%s' % (self._getPrefix(),
                common.PIVOT))

        self.__bankOutPivot = cmds.createNode('joint',
                n = '%s_bankOut_%s' % (self._getPrefix(),
                common.PIVOT))

        self.__heelPivot = cmds.createNode('joint',
                n = '%s_heel_%s' % (self._getPrefix(),
                common.PIVOT))

        #move pivots into position
        x,y,z = positions[1]
        cmds.xform(self.__bankInPivot, ws = True, t = [x + bankInOffset, y, z])
        cmds.xform(self.__bankOutPivot, ws = True, t = [x + bankOutOffset, y, z])
        cmds.xform(self.__heelPivot, ws = True, t = [x, y, z  - 4])

        #parent pivots
        for pivot in [self.__bankInPivot, self.__bankOutPivot, self.__heelPivot]:
            cmds.parent(pivot, self.skeletonGrp)
        #end loop


        # ----------------------------------------------------------------------
        # CREATE GUIDES
        ankleJointGuide = self.ankleJoint.replace(common.JOINT, common.GUIDES)
        ballointGuide   = self.ballJoint.replace(common.JOINT, common.GUIDES)
        toeJointGuide   = self.toeJoint.replace(common.JOINT, common.GUIDES)
        bankInPivotGuide   = \
                self.setupCtrl(self.__bankInPivot.replace('_%s' % common.JOINT, ''),
                self.__bankInPivot,
                color = common.SIDE_COLOR_SECONDARY[self._getSide()])

        bankOutPivotGuide   = \
                self.setupCtrl(self.__bankOutPivot.replace('_%s' % common.JOINT,''),
                self.__bankOutPivot,
                color = common.SIDE_COLOR_SECONDARY[self._getSide()])

        heelPivotGuide   = \
                self.setupCtrl(self.__heelPivot.replace('_%s' % common.JOINT, ''),
                self.__heelPivot,
                color = common.SIDE_COLOR_SECONDARY[self._getSide()])


        cmds.pointConstraint(self.ballJoint,
                common.getParent(bankOutPivotGuide), mo = True)

        cmds.pointConstraint(self.ballJoint,
                common.getParent(bankInPivotGuide), mo = True)

        #resize pivot controls
        for ctrl in [heelPivotGuide, bankOutPivotGuide, bankInPivotGuide]:
            cmds.setAttr('%s.radius' % common.getShapes(ctrl)[0],
                    self.controlScale * .5)
コード例 #8
0
ファイル: foot.py プロジェクト: jonntd/japeto
    def rig(self):
        if not self._puppetNode:
            self.runSetupRig()
        
        if common.isValid('%s_%s%s' % (self.name(), common.IK, common.FK)):
            return True
        
        cmds.parent([self.__bankInPivot,
                self.__bankOutPivot,
                self.__heelPivot],
                w = True)

        if super(Foot,self).rig():
            return True

        #create foot ik/fk chain and parent group to joints group
        self.__footIkFk = \
                ikfk.IkFkFoot(self.ankleJoint,
                        self.toeJoint,
                        name = self.name())

        #list the groups for the foot ik setup
        self.__footRollGroups.insert(0, 'anklePivot')
        footRollGrpList = self.__footRollGroups

        #create foot setup
        self.__footIkFk.create(searchReplace = '%s' % common.SKINCLUSTER,
                footRollGrpList = footRollGrpList)

        #parent to joints group
        cmds.parent(self.__footIkFk.group, self.jointsGrp)

        #get position of joints
        anklePosition    = \
            cmds.xform(self.ankleJoint, q = True, ws = True, rp = True)

        ballPosition     = \
            cmds.xform(self.ballJoint, q = True, ws = True, rp = True)

        toePosition      = \
            cmds.xform(self.toeJoint, q = True, ws = True, rp = True)

        bankInPosition   = \
            cmds.xform(self.__bankInPivot, q = True, ws = True, rp = True)

        bankOutPosition  = \
            cmds.xform(self.__bankOutPivot, q = True, ws = True, rp = True)

        heelPosition     = \
            cmds.xform(self.__heelPivot, q = True, ws = True, rp = True)

        #delete pivot joints
        for jnt in (self.__heelPivot,self.__bankOutPivot, self.__bankInPivot):
            cmds.delete(jnt)
        #end loop

        #get foot roll groups
        footRollGroups = self.__footIkFk.getFootRolls()
        handles = self.__footIkFk.getIkHandles()

        #position foot roll groups
        for grp in footRollGroups:
            if grp in ['ballRoll', 'toeBend']:
                cmds.xform(footRollGroups[grp], ws = True, rp = ballPosition)
            elif grp in ['heelRoll', 'heelPivot']:
                if grp == self.__heelPivotName:
                    cmds.setAttr('%s.rotateOrder' % footRollGroups[grp], 2)
                cmds.xform(footRollGroups[grp], ws = True, rp = heelPosition)
            elif grp in ['toeRoll', 'toePivot']: 
                cmds.xform(footRollGroups[grp], ws = True, rp = toePosition)
            elif grp in ['bankIn', self.__bankInZero]: 
                cmds.xform(footRollGroups[grp], ws = True, rp = bankInPosition)
            elif grp in ['bankOut', self.__bankOutZero]: 
                cmds.xform(footRollGroups[grp], ws = True, rp = bankOutPosition)
                cmds.setAttr('%s.rotateOrder' % footRollGroups[grp], 2)
            elif grp in ['anklePivot']: 
                cmds.xform(footRollGroups[grp], ws = True, rp = anklePosition)
        #end loop


        #create controls
        self.__footCtrl      = \
            control.create(name= self.name(),
                    type = 'implicitSphere',
                    parent = self.controlsGrp,
                    color = common.SIDE_COLOR[self._getSide()])

        self.__bankInCtrl    = \
            control.create(name= footRollGroups[self.__bankIn] ,
                    type = 'implicitSphere',
                    parent = self.controlsGrp,
                    color = common.SIDE_COLOR_SECONDARY[self._getSide()])

        self.__bankOutCtrl   = \
            control.create(name= footRollGroups[self.__bankOut] ,
                    type = 'implicitSphere',
                    parent = self.controlsGrp,
                    color = common.SIDE_COLOR_SECONDARY[self._getSide()])

        self.__heelPivotCtrl = \
            control.create(name= footRollGroups[self.__heelPivotName] ,
                    type = 'implicitSphere',
                    parent = self.controlsGrp,
                    color = common.SIDE_COLOR_SECONDARY[self._getSide()])

        #parent of controls
        parentBankOutCtrl   = common.getParent(self.__bankOutCtrl)
        parentBankInCtrl    = common.getParent(self.__bankInCtrl)
        parentHeelPivotCtrl = common.getParent(self.__heelPivotCtrl)

        #scale controls
        for ctrl in [self.__footCtrl,self.__bankOutCtrl, self.__bankInCtrl, self.__heelPivotCtrl]:
            for i in range(len(common.getShapes(ctrl))):
                control.scaleShape (ctrl, scale = [.3, .3, .3], index = i)


        #place controls in correct positions
        transform.matchXform(self.ankleJoint,
                common.getParent(self.__footCtrl),
                type = 'pose')

        cmds.xform(common.getParent(self.__footCtrl),
                ws = True,
                r = True,
                t = [0,0,-2])

        cmds.delete(cmds.parentConstraint(footRollGroups['bankIn'],
                parentBankInCtrl))

        cmds.delete(cmds.parentConstraint(footRollGroups['bankOut'],
                parentBankOutCtrl))

        cmds.delete(cmds.parentConstraint(footRollGroups['heelPivot'],
                parentHeelPivotCtrl))

        #Decompose matrix nodes for pivots and connect the controls to them
        for ctrl, grp in zip([self.__bankInCtrl, self.__bankOutCtrl, self.__heelPivotCtrl] , [footRollGroups['bankIn'], footRollGroups['bankOut'], footRollGroups[self.__heelRoll]]):
            grpZero = common.getChildren(grp)[0]

            dcm = cmds.createNode('decomposeMatrix',
                    n = '%s_%s' % (grp, common.DECOMPOSEMATRIX))

            mdn = cmds.createNode('multiplyDivide',
                    n = '%s_%s' % (grp, common.MULTIPLYDIVIDE))

            attribute.connect('%s.worldMatrix[0]' % ctrl, '%s.inputMatrix' % dcm)

            #connect controls to pivots
            attribute.connect('%s.outputTranslate' % dcm, '%s.rotatePivot' % grp)
            attribute.connect('%s.outputTranslate' % dcm, '%s.rotatePivot' % grpZero)
            #Change attributes on Multiply divide node and make connections
            cmds.setAttr('%s.input2Y' % mdn, -1)
            attribute.connect('%s.ry' % ctrl, '%s.input1Y' % mdn)
            attribute.connect('%s.outputY' % mdn, '%s.ry' % grpZero)
            attribute.connect('%s.ry' % ctrl, '%s.ry' % grp)


        #parent constrain the foot control to the ankle joint
        for node in [self.__footCtrl,parentBankOutCtrl,  parentBankInCtrl, parentHeelPivotCtrl]:
            cmds.parentConstraint(footRollGroups['anklePivot'], node, mo = True)


        #add attributes to the foot control and connect them to the pivots
        ikfkAttr      = \
            attribute.addAttr(self.__footCtrl,
                    'ikfk' ,
                    attrType = 'enum',
                    defValue = ['off', 'on'],
                    value = 0)

        bankAttr      = \
            attribute.addAttr(self.__footCtrl,
                    'bank' ,
                    attrType = 'double',
                    defValue = 0,
                    min = -10,
                    max = 10)

        ballRollAttr  = \
            attribute.addAttr(self.__footCtrl,
                    self.__ballRoll ,
                    attrType = 'double',
                    defValue = 0,
                    min = 0,
                    max = 10)

        toeRollAttr   = \
            attribute.addAttr(self.__footCtrl,
                    self.__toeRoll ,
                    attrType = 'double',
                    defValue = 0,
                    min = 0,
                    max = 10)

        toePivotAttr  = \
            attribute.addAttr(self.__footCtrl,
                    self.__toePivot ,
                    attrType = 'double',
                    defValue = 0,
                    min = -10,
                    max = 10)

        toeBendAttr   = \
            attribute.addAttr(self.__footCtrl,
                    self.__toeBend ,
                    attrType = 'double',
                    defValue = 0,
                    min = -10,
                    max = 10)

        heelRollAttr  = \
            attribute.addAttr(self.__footCtrl,
                    self.__heelRoll ,
                    attrType = 'double',
                    defValue = 0,
                    min = -10,
                    max = 0)

        heelPivotAttr = \
            attribute.addAttr(self.__footCtrl,
                    self.__heelPivotName ,
                    attrType = 'double',
                    defValue = 0,
                    min = -10,
                    max = 10)

        self.__footRollAttrs.extend([ikfkAttr,
                bankAttr,
                ballRollAttr,
                toeRollAttr ,
                toePivotAttr,
                toeBendAttr,
                heelRollAttr,
                heelPivotAttr])

        #create remap dictionary to place remap nodes in based on foot roll group names
        ramapNodes = dict()

        #create remap nodes and connect them to foot roll groups
        for attr in [bankAttr,toePivotAttr,toeBendAttr,heelPivotAttr]:
            node, attrName = attr.split('.')
            ramapNodes[attrName] = \
                cmds.createNode('remapValue',
                        n = '%s_%s_%s' % (node, attrName, common.REMAP))

            attribute.connect(attr, '%s.inputValue' % ramapNodes[attrName])
            cmds.setAttr('%s.outputMax' % ramapNodes[attrName], 100)
            cmds.setAttr('%s.outputMin' % ramapNodes[attrName], -100)
            cmds.setAttr('%s.inputMax' % ramapNodes[attrName], 10)
            cmds.setAttr('%s.inputMin' % ramapNodes[attrName], -10)
        #end loop

        for attr in [ballRollAttr,toeRollAttr, heelRollAttr]:
            node, attrName = attr.split('.')
            ramapNodes[attrName] = \
                cmds.createNode('remapValue',
                        n = '%s_%s_%s' % (node, attrName, common.REMAP))
            attribute.connect(attr, '%s.inputValue' % ramapNodes[attrName])
            cmds.setAttr('%s.outputMax' % ramapNodes[attrName], 100)
            cmds.setAttr('%s.outputMin' % ramapNodes[attrName], 0)
            cmds.setAttr('%s.inputMax' % ramapNodes[attrName], 10)
            cmds.setAttr('%s.inputMin' % ramapNodes[attrName], 0)

            if attr == heelRollAttr:
                cmds.setAttr('%s.outputMax' % ramapNodes[attrName], 0)
                cmds.setAttr('%s.outputMin' % ramapNodes[attrName], -100)
                cmds.setAttr('%s.inputMax' % ramapNodes[attrName], 0)
                cmds.setAttr('%s.inputMin' % ramapNodes[attrName], -10)
            #end if
        #end loop

        #connect remap nodes to roll groups    
        #---Bank In/Out---
        if self._getSide() == common.LEFT:
            attribute.connect('%s.outValue' % ramapNodes['bank'],
                              '%s.rz' % footRollGroups[self.__bankIn])

            attribute.connect('%s.outValue' % ramapNodes['bank'],
                              '%s.rz' % footRollGroups[self.__bankOut])

            cmds.transformLimits(footRollGroups[self.__bankIn],
                    rz =[0, 100],
                    erz = [1, 1])

            cmds.transformLimits(footRollGroups[self.__bankOut],
                    rz =[-100, 0],
                    erz = [1, 1])
        elif self._getSide() == common.RIGHT:
            invertMDN = \
                cmds.createNode('multiplyDivide',
                        n = '%s_bankInvert_%s' % (self._getSide(),
                        common.MULTIPLYDIVIDE))

            cmds.setAttr('%s.input2X' % invertMDN, -1)
            attribute.connect('%s.outValue' % ramapNodes['bank'],
                    '%s.input1X' % invertMDN)

            attribute.connect('%s.outputX' % invertMDN,
                    '%s.rz' % footRollGroups[self.__bankIn])

            attribute.connect('%s.outputX' % invertMDN,
                    '%s.rz' % footRollGroups[self.__bankOut])

            cmds.transformLimits(footRollGroups[self.__bankIn],
                    rz =[-100, 0],
                    erz = [1, 1])

            cmds.transformLimits(footRollGroups[self.__bankOut],
                    rz =[0, 100],
                    erz = [1, 1])

        #---Ball Roll---
        attribute.connect('%s.outValue' % ramapNodes[self.__ballRoll],
                '%s.rx' % footRollGroups[self.__ballRoll])
        #---Toe Roll---
        attribute.connect('%s.outValue' % ramapNodes[self.__toeRoll],
                '%s.rx' % footRollGroups[self.__toeRoll])
        #---Toe Pivot---
        attribute.connect('%s.outValue' % ramapNodes[self.__toePivot],
                '%s.ry' % footRollGroups[self.__toePivot])
        #---Heel Roll---
        attribute.connect('%s.outValue' % ramapNodes[self.__heelRoll],
                '%s.rx' % footRollGroups[self.__heelRoll])
        #---Heel Pivot---
        attribute.connect('%s.outValue' % ramapNodes[self.__heelPivotName],
                '%s.ry' % footRollGroups[self.__heelPivotName])
        #---IK/FK---
        attribute.connect(ikfkAttr,
                '%s.ikfk' % self.__footIkFk.group)
        #---Ball Roll---
        attribute.connect('%s.outValue' % ramapNodes[self.__toeBend],
                '%s.rx' % footRollGroups[self.__toeBend])

        #connect fk joints to the ankle pivot
        #cmds.parentConstraint(footRollGroups['anklePivot'], self.__footIkFk.fkJoints[0], mo = True)

        #connecting visibility of control shapes to the controls
        ikfkReverse = \
            cmds.createNode('reverse', n = '%s_%s' % (self.name(),common.REVERSE))

        attribute.connect(ikfkAttr, '%s.inputX' % ikfkReverse)

        for ikCtrl in [self.__bankInCtrl,self.__bankOutCtrl,self.__heelPivotCtrl]:
            cmds.setAttr('%s.rotateOrder' % ikCtrl, 2)
            for shape in common.getShapes(ikCtrl):
                if shape:
                    attribute.connect('%s.outputX' % ikfkReverse, '%s.v' % shape)

        #----FK Setup---
        fkCtrls = list()
        parent = self.controlsGrp
        for jnt in self.__footIkFk.fkJoints:
            if jnt == self.__footIkFk.fkJoints[-1]:
                continue
            #end if

            ctrl = \
                control.create(name= jnt.split('_%s' % common.JOINT)[0],
                        type = 'circle',
                        parent = parent,
                        color = common.SIDE_COLOR[self._getSide()])

            ctrlParent = common.getParent(ctrl)
            transform.matchXform(jnt, ctrlParent, type = 'pose')
            cmds.parentConstraint(ctrl, jnt, mo = True) #----> might change this to connect rotations and not use translation
            if jnt == self.__footIkFk.fkJoints[0]:
                cmds.parentConstraint(footRollGroups['anklePivot'],
                    ctrlParent,
                    mo = True)
            #end if

            #connect visibility of shapes to foot control
            for shape in common.getShapes(ctrl):
                attribute.connect(ikfkAttr, '%s.v' % shape)
            #end for    
            parent = ctrl
            fkCtrls.append(ctrl)

        #assign hooks
        self.hookRoot.extend([footRollGroups['anklePivot'], common.getParent(fkCtrls[0])])
        self.hookPoint.extend([footRollGroups['ballRoll']])