Exemple #1
0
 def rigModule(self, *args):
     Base.StartClass.rigModule(self)
     # verify if the guide exists:
     if cmds.objExists(self.moduleGrp):
         try:
             hideJoints = cmds.checkBox("hideJointsCB", query=True, value=True)
         except:
             hideJoints = 1
         # declare lists to store names and attributes:
         self.hipsAList, self.chestAList, self.volumeVariationAttrList = [], [], []
         # start as no having mirror:
         sideList = [""]
         # analisys the mirror module:
         self.mirrorAxis = cmds.getAttr(self.moduleGrp + ".mirrorAxis")
         if self.mirrorAxis != "off":
             # get rigs names:
             self.mirrorNames = cmds.getAttr(self.moduleGrp + ".mirrorName")
             # get first and last letters to use as side initials (prefix):
             sideList = [self.mirrorNames[0] + "_", self.mirrorNames[len(self.mirrorNames) - 1] + "_"]
             for s, side in enumerate(sideList):
                 duplicated = cmds.duplicate(self.moduleGrp, name=side + self.userGuideName + "_Guide_Base")[0]
                 allGuideList = cmds.listRelatives(duplicated, allDescendents=True)
                 for item in allGuideList:
                     cmds.rename(item, side + self.userGuideName + "_" + item)
                 self.mirrorGrp = cmds.group(name="Guide_Base_Grp", empty=True)
                 cmds.parent(side + self.userGuideName + "_Guide_Base", self.mirrorGrp, absolute=True)
                 # re-rename grp:
                 cmds.rename(self.mirrorGrp, side + self.userGuideName + "_" + self.mirrorGrp)
                 # do a group mirror with negative scaling:
                 if s == 1:
                     for axis in self.mirrorAxis:
                         cmds.setAttr(side + self.userGuideName + "_" + self.mirrorGrp + ".scale" + axis, -1)
         else:  # if not mirror:
             duplicated = cmds.duplicate(self.moduleGrp, name=self.userGuideName + "_Guide_Base")[0]
             allGuideList = cmds.listRelatives(duplicated, allDescendents=True)
             for item in allGuideList:
                 cmds.rename(item, self.userGuideName + "_" + item)
             self.mirrorGrp = cmds.group(self.userGuideName + "_Guide_Base", name="Guide_Base_Grp", relative=True)
             # re-rename grp:
             cmds.rename(self.mirrorGrp, self.userGuideName + "_" + self.mirrorGrp)
         # store the number of this guide by module type
         dpAR_count = utils.findModuleLastNumber(CLASS_NAME, "dpAR_type") + 1
         # run for all sides
         for s, side in enumerate(sideList):
             self.base = side + self.userGuideName + "_Guide_Base"
             # get the number of joints to be created:
             self.nJoints = cmds.getAttr(self.base + ".nJoints")
             # create controls:
             self.hipsA = ctrls.cvBox(
                 ctrlName=side + self.userGuideName + "_" + self.langDic[self.langName]["c_hips"] + "A_Ctrl",
                 r=self.ctrlRadius,
                 h=(self.ctrlRadius * 0.25),
             )
             self.hipsB = cmds.circle(
                 name=side + self.userGuideName + "_" + self.langDic[self.langName]["c_hips"] + "B_Ctrl",
                 ch=False,
                 o=True,
                 nr=(0, 1, 0),
                 d=1,
                 s=8,
                 radius=self.ctrlRadius,
             )[0]
             self.chestA = ctrls.cvBox(
                 ctrlName=side + self.userGuideName + "_" + self.langDic[self.langName]["c_chest"] + "A_Ctrl",
                 r=self.ctrlRadius,
                 h=(self.ctrlRadius * 0.25),
             )
             self.chestB = cmds.circle(
                 name=side + self.userGuideName + "_" + self.langDic[self.langName]["c_chest"] + "B_Ctrl",
                 ch=False,
                 o=True,
                 nr=(0, 1, 0),
                 d=1,
                 s=8,
                 radius=self.ctrlRadius,
             )[0]
             cmds.addAttr(
                 self.hipsA,
                 longName=side + self.userGuideName + "_" + self.langDic[self.langName]["c_volumeVariation"],
                 attributeType="float",
                 defaultValue=1,
                 keyable=True,
             )
             ctrls.setLockHide([self.hipsA, self.hipsB, self.chestA, self.chestB], ["v"], l=False)
             self.hipsAList.append(self.hipsA)
             self.chestAList.append(self.chestA)
             self.volumeVariationAttrList.append(
                 side + self.userGuideName + "_" + self.langDic[self.langName]["c_volumeVariation"]
             )
             # organize hierarchy:
             cmds.parent(self.hipsB, self.hipsA)
             cmds.parent(self.chestB, self.chestA)
             cmds.parent(self.chestA, self.hipsA)
             cmds.rotate(-90, 0, 0, self.hipsA)
             cmds.makeIdentity(self.hipsA, apply=True, rotate=True)
             # position of controls:
             bottomLocGuide = side + self.userGuideName + "_Guide_JointLoc1"
             topLocGuide = side + self.userGuideName + "_Guide_JointLoc" + str(self.nJoints)
             # snap controls to guideLocators:
             tempDel = cmds.parentConstraint(bottomLocGuide, self.hipsA, maintainOffset=False)
             cmds.delete(tempDel)
             tempDel = cmds.parentConstraint(topLocGuide, self.chestA, maintainOffset=False)
             cmds.delete(tempDel)
             # zeroOut transformations:
             utils.zeroOut([self.hipsA, self.chestA])
             # modify the pivots of chest controls:
             upPivotPos = cmds.xform(
                 side + self.userGuideName + "_Guide_JointLoc" + str(self.nJoints - 1),
                 query=True,
                 worldSpace=True,
                 translation=True,
             )
             cmds.move(
                 upPivotPos[0],
                 upPivotPos[1],
                 upPivotPos[2],
                 self.chestA + ".scalePivot",
                 self.chestA + ".rotatePivot",
             )  # , self.chestB+".scalePivot", self.chestB+".rotatePivot")
             # add originedFrom attributes to hipsA, hipsB and chestB:
             utils.originedFrom(objName=self.hipsA, attrString=self.base)
             utils.originedFrom(objName=self.hipsB, attrString=bottomLocGuide)
             utils.originedFrom(objName=self.chestB, attrString=topLocGuide)
             # create a simple spine ribbon:
             returnedRibbonList = ctrls.createSimpleRibbon(
                 name=side + self.userGuideName + "_Rbn", totalJoints=(self.nJoints - 1)
             )
             rbnNurbsPlane = returnedRibbonList[0]
             rbnNurbsPlaneShape = returnedRibbonList[1]
             rbnJointGrpList = returnedRibbonList[2]
             rbnJointList = returnedRibbonList[3]
             # position of ribbon nurbs plane:
             cmds.setAttr(rbnNurbsPlane + ".tz", -4)
             cmds.move(0, 0, 0, rbnNurbsPlane + ".scalePivot", rbnNurbsPlane + ".rotatePivot")
             cmds.rotate(90, 90, 0, rbnNurbsPlane)
             cmds.makeIdentity(rbnNurbsPlane, apply=True, translate=True, rotate=True)
             downLocPos = cmds.xform(
                 side + self.userGuideName + "_Guide_JointLoc1", query=True, worldSpace=True, translation=True
             )
             upLocPos = cmds.xform(
                 side + self.userGuideName + "_Guide_JointLoc" + str(self.nJoints),
                 query=True,
                 worldSpace=True,
                 translation=True,
             )
             cmds.move(downLocPos[0], downLocPos[1], downLocPos[2], rbnNurbsPlane)
             # create up and down clusters:
             downCluster = cmds.cluster(
                 rbnNurbsPlane + ".cv[0:3][0:1]", name=side + self.userGuideName + "_Down_Cls"
             )[1]
             upCluster = cmds.cluster(
                 rbnNurbsPlane + ".cv[0:3][" + str(self.nJoints) + ":" + str(self.nJoints + 1) + "]",
                 name=side + self.userGuideName + "_Up_Cls",
             )[1]
             # get positions of joints from ribbon nurbs plane:
             startRbnJointPos = cmds.xform(
                 side + self.userGuideName + "_Rbn0_Jnt", query=True, worldSpace=True, translation=True
             )
             endRbnJointPos = cmds.xform(
                 side + self.userGuideName + "_Rbn" + str(self.nJoints - 1) + "_Jnt",
                 query=True,
                 worldSpace=True,
                 translation=True,
             )
             # move pivots of clusters to start and end positions:
             cmds.move(
                 startRbnJointPos[0],
                 startRbnJointPos[1],
                 startRbnJointPos[2],
                 downCluster + ".scalePivot",
                 downCluster + ".rotatePivot",
             )
             cmds.move(
                 endRbnJointPos[0],
                 endRbnJointPos[1],
                 endRbnJointPos[2],
                 upCluster + ".scalePivot",
                 upCluster + ".rotatePivot",
             )
             # snap clusters to guideLocators:
             tempDel = cmds.parentConstraint(bottomLocGuide, downCluster, maintainOffset=False)
             cmds.delete(tempDel)
             tempDel = cmds.parentConstraint(topLocGuide, upCluster, maintainOffset=False)
             cmds.delete(tempDel)
             # rotate clusters to compensate guide:
             upClusterRot = cmds.xform(upCluster, query=True, worldSpace=True, rotation=True)
             downClusterRot = cmds.xform(downCluster, query=True, worldSpace=True, rotation=True)
             cmds.xform(
                 upCluster, worldSpace=True, rotation=(upClusterRot[0] + 90, upClusterRot[1], upClusterRot[2])
             )
             cmds.xform(
                 downCluster,
                 worldSpace=True,
                 rotation=(downClusterRot[0] + 90, downClusterRot[1], downClusterRot[2]),
             )
             # scaleY of the clusters in order to avoid great extremity deforms:
             rbnHeight = ctrls.distanceBet(
                 side + self.userGuideName + "_Guide_JointLoc" + str(self.nJoints),
                 side + self.userGuideName + "_Guide_JointLoc1",
                 keep=False,
             )[0]
             cmds.setAttr(upCluster + ".sy", rbnHeight / 10)
             cmds.setAttr(downCluster + ".sy", rbnHeight / 10)
             # parent clusters in controls (up and down):
             cmds.parentConstraint(
                 self.hipsB, downCluster, maintainOffset=True, name=downCluster + "_ParentConstraint"
             )
             cmds.parentConstraint(self.chestB, upCluster, maintainOffset=True, name=upCluster + "_ParentConstraint")
             # organize a group of clusters:
             self.clustersGrp = cmds.group(name=side + self.userGuideName + "_Rbn_Clusters_Grp", empty=True)
             if hideJoints:
                 cmds.setAttr(self.clustersGrp + ".visibility", 0)
             cmds.parent(downCluster, upCluster, self.clustersGrp, relative=True)
             # make ribbon joints groups scalable:
             for r, rbnJntGrp in enumerate(rbnJointGrpList):
                 if (r > 0) and (r < (len(rbnJointGrpList) - 1)):
                     scaleGrp = cmds.group(rbnJntGrp, name=rbnJntGrp.replace("_Grp", "_Scale_Grp"))
                     ctrls.directConnect(scaleGrp, rbnJntGrp, ["sx", "sz"])
                     cmds.scaleConstraint(self.clustersGrp, scaleGrp, maintainOffset=True, name=rbnJntGrp + "_Scale")
                 else:
                     cmds.scaleConstraint(
                         self.clustersGrp, rbnJntGrp, maintainOffset=True, name=rbnJntGrp + "_Scale"
                     )
             # calculate the distance to volumeVariation:
             arcLenShape = cmds.createNode("arcLengthDimension", name=side + self.userGuideName + "_Rbn_ArcLenShape")
             arcLenFather = cmds.listRelatives(arcLenShape, parent=True)[0]
             arcLen = cmds.rename(arcLenFather, side + self.userGuideName + "_Rbn_ArcLen")
             arcLenShape = cmds.listRelatives(arcLen, children=True, shapes=True)[0]
             cmds.setAttr(arcLen + ".visibility", 0)
             # connect nurbsPlaneShape to arcLength node:
             cmds.connectAttr(rbnNurbsPlaneShape + ".worldSpace[0]", arcLenShape + ".nurbsGeometry")
             cmds.setAttr(arcLenShape + ".vParamValue", 1)
             # avoid undesired squash if rotateZ the nurbsPlane:
             cmds.setAttr(arcLenShape + ".uParamValue", 0.5)
             arcLenValue = cmds.getAttr(arcLenShape + ".arcLengthInV")
             # create a multiplyDivide to output the squashStretch values:
             rbnMD = cmds.createNode("multiplyDivide", name=side + self.userGuideName + "_Rbn_MD")
             cmds.connectAttr(arcLenShape + ".arcLengthInV", rbnMD + ".input2X")
             cmds.setAttr(rbnMD + ".input1X", arcLenValue)
             cmds.setAttr(rbnMD + ".operation", 2)
             # create a blendColor in order to get the correct result value of volumeVariation:
             rbnBlendColors = cmds.createNode("blendColors", name=side + self.userGuideName + "_Rbn_BlendColor")
             cmds.connectAttr(
                 self.hipsA
                 + "."
                 + side
                 + self.userGuideName
                 + "_"
                 + self.langDic[self.langName]["c_volumeVariation"],
                 rbnBlendColors + ".blender",
             )
             cmds.connectAttr(rbnMD + ".outputX", rbnBlendColors + ".color1R")
             cmds.setAttr(rbnBlendColors + ".color2R", 1)
             # middle ribbon setup:
             for n in range(1, self.nJoints - 1):
                 self.middle = cmds.circle(
                     name=side
                     + self.userGuideName
                     + "_"
                     + self.langDic[self.langName]["c_middle"]
                     + str(n)
                     + "_Ctrl",
                     ch=False,
                     o=True,
                     nr=(0, 0, 1),
                     d=3,
                     s=8,
                     radius=self.ctrlRadius,
                 )[0]
                 ctrls.setLockHide([self.middle], ["sx", "sy", "sz"])
                 cmds.setAttr(self.middle + ".visibility", keyable=False)
                 cmds.parent(self.middle, self.hipsA)
                 middleLocGuide = side + self.userGuideName + "_Guide_JointLoc" + str(n + 1)
                 tempDel = cmds.parentConstraint(middleLocGuide, self.middle, maintainOffset=False)
                 cmds.delete(tempDel)
                 utils.zeroOut([self.middle])
                 middleCluster = cmds.cluster(
                     rbnNurbsPlane + ".cv[0:3][" + str(n + 1) + "]", name=side + self.userGuideName + "_Middle_Cls"
                 )[1]
                 middleLocPos = cmds.xform(
                     side + self.userGuideName + "_Guide_JointLoc" + str(n),
                     query=True,
                     worldSpace=True,
                     translation=True,
                 )
                 tempDel = cmds.parentConstraint(middleLocGuide, middleCluster, maintainOffset=False)
                 cmds.delete(tempDel)
                 middleClusterRot = cmds.xform(middleCluster, query=True, worldSpace=True, rotation=True)
                 cmds.xform(
                     middleCluster,
                     worldSpace=True,
                     rotation=(middleClusterRot[0] + 90, middleClusterRot[1], middleClusterRot[2]),
                 )
                 cmds.parentConstraint(
                     self.middle, middleCluster, maintainOffset=True, name=middleCluster + "_ParentConstraint"
                 )
                 # parenting constraints like guide locators:
                 self.parentConst = cmds.parentConstraint(
                     self.hipsB,
                     self.chestB,
                     self.middle + "_Zero",
                     name=self.middle + "_ParentConstraint",
                     maintainOffset=True,
                 )[0]
                 nParentValue = (n) / float(self.nJoints - 1)
                 cmds.setAttr(self.parentConst + "." + self.hipsB + "W0", 1 - nParentValue)
                 cmds.setAttr(self.parentConst + "." + self.chestB + "W1", nParentValue)
                 cmds.parent(middleCluster, self.clustersGrp, relative=True)
                 # add originedFrom attribute to this middle ctrl:
                 utils.originedFrom(objName=self.middle, attrString=middleLocGuide)
                 # apply volumeVariation to joints in the middle ribbon setup:
                 cmds.connectAttr(rbnBlendColors + ".outputR", rbnJointList[n] + ".scaleX")
                 cmds.connectAttr(rbnBlendColors + ".outputR", rbnJointList[n] + ".scaleZ")
             # organize groups:
             self.rbnRigGrp = cmds.group(name=side + self.userGuideName + "_Grp", empty=True)
             self.rbnControlGrp = cmds.group(name=side + self.userGuideName + "_Control_Grp", empty=True)
             cmds.parent(self.hipsA + "_Zero", self.rbnControlGrp, relative=True)
             cmds.parent(
                 self.clustersGrp,
                 side + self.userGuideName + "_Rbn_RibbonJoint_Grp",
                 self.rbnControlGrp,
                 arcLen,
                 self.rbnRigGrp,
                 relative=True,
             )
             if hideJoints:
                 cmds.setAttr(side + self.userGuideName + "_Rbn_RibbonJoint_Grp.visibility", 0)
             # add hook attributes to be read when rigging integrated modules:
             utils.addHook(objName=self.rbnControlGrp, hookType="ctrlHook")
             utils.addHook(objName=self.clustersGrp, hookType="scalableHook")
             utils.addHook(objName=self.rbnRigGrp, hookType="staticHook")
             cmds.addAttr(self.rbnRigGrp, longName="dpAR_name", dataType="string")
             cmds.addAttr(self.rbnRigGrp, longName="dpAR_type", dataType="string")
             cmds.setAttr(self.rbnRigGrp + ".dpAR_name", self.userGuideName, type="string")
             cmds.setAttr(self.rbnRigGrp + ".dpAR_type", CLASS_NAME, type="string")
             # add module type counter value
             cmds.addAttr(self.rbnRigGrp, longName="dpAR_count", attributeType="long", keyable=False)
             cmds.setAttr(self.rbnRigGrp + ".dpAR_count", dpAR_count)
             # lockHide scale of up and down controls:
             ctrls.setLockHide([self.hipsA, self.hipsB, self.chestA, self.chestB], ["sx", "sy", "sz"])
             # delete duplicated group for side (mirror):
             cmds.delete(side + self.userGuideName + "_" + self.mirrorGrp)
         # finalize this rig:
         self.integratingInfo()
         cmds.select(clear=True)
     # delete UI (moduleLayout), GUIDE and moduleInstance namespace:
     self.deleteModule()
Exemple #2
0
 def createGuide(self, *args):
     Base.StartClass.createGuide(self)
     # Custom GUIDE:
     cmds.setAttr(self.moduleGrp + ".moduleNamespace", self.moduleGrp[: self.moduleGrp.rfind(":")], type="string")
     # create cvJointLoc and cvLocators:
     self.cvNeckLoc, shapeSizeCH = ctrls.cvJointLoc(ctrlName=self.guideName + "_neck", r=0.5)
     self.connectShapeSize(shapeSizeCH)
     self.cvHeadLoc, shapeSizeCH = ctrls.cvLocator(ctrlName=self.guideName + "_head", r=0.4)
     self.connectShapeSize(shapeSizeCH)
     self.cvJawLoc, shapeSizeCH = ctrls.cvLocator(ctrlName=self.guideName + "_jaw", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     self.cvChinLoc, shapeSizeCH = ctrls.cvLocator(ctrlName=self.guideName + "_chin", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     self.cvLLipLoc, shapeSizeCH = ctrls.cvLocator(ctrlName=self.guideName + "_lLip", r=0.1)
     self.connectShapeSize(shapeSizeCH)
     self.cvRLipLoc, shapeSizeCH = ctrls.cvLocator(ctrlName=self.guideName + "_rLip", r=0.1)
     self.connectShapeSize(shapeSizeCH)
     # create jointGuides:
     self.jGuideNeck = cmds.joint(name=self.guideName + "_JGuideNeck", radius=0.001)
     self.jGuideHead = cmds.joint(name=self.guideName + "_JGuideHead", radius=0.001)
     self.jGuideJaw = cmds.joint(name=self.guideName + "_JGuideJaw", radius=0.001)
     self.jGuideChin = cmds.joint(name=self.guideName + "_JGuideChin", radius=0.001)
     # set jointGuides as templates:
     cmds.setAttr(self.jGuideNeck + ".template", 1)
     cmds.setAttr(self.jGuideHead + ".template", 1)
     cmds.setAttr(self.jGuideJaw + ".template", 1)
     cmds.setAttr(self.jGuideChin + ".template", 1)
     cmds.parent(self.jGuideNeck, self.moduleGrp, relative=True)
     # create cvEnd:
     self.cvEndJoint, shapeSizeCH = ctrls.cvLocator(ctrlName=self.guideName + "_JointEnd", r=0.1)
     self.connectShapeSize(shapeSizeCH)
     cmds.parent(self.cvEndJoint, self.cvChinLoc)
     cmds.setAttr(self.cvEndJoint + ".tz", 1.3)
     self.jGuideEnd = cmds.joint(name=self.guideName + "_JGuideEnd", radius=0.001)
     cmds.setAttr(self.jGuideEnd + ".template", 1)
     cmds.parent(self.jGuideEnd, self.jGuideChin)
     # make parents between cvLocs:
     cmds.parent(self.cvNeckLoc, self.moduleGrp)
     cmds.parent(self.cvHeadLoc, self.cvNeckLoc)
     cmds.parent(self.cvJawLoc, self.cvHeadLoc)
     cmds.parent(self.cvChinLoc, self.cvJawLoc)
     cmds.parent(self.cvLLipLoc, self.cvJawLoc)
     cmds.parent(self.cvRLipLoc, self.cvJawLoc)
     # connect cvLocs in jointGuides:
     ctrls.directConnect(self.cvNeckLoc, self.jGuideNeck, ["tx", "ty", "tz", "rx", "ry", "rz"])
     ctrls.directConnect(self.cvHeadLoc, self.jGuideHead, ["tx", "ty", "tz", "rx", "ry", "rz"])
     ctrls.directConnect(self.cvJawLoc, self.jGuideJaw, ["tx", "ty", "tz", "rx", "ry", "rz"])
     ctrls.directConnect(self.cvChinLoc, self.jGuideChin, ["tx", "ty", "tz", "rx", "ry", "rz"])
     ctrls.directConnect(self.cvEndJoint, self.jGuideEnd, ["tx", "ty", "tz", "rx", "ry", "rz"])
     # limit, lock and hide cvEnd:
     cmds.transformLimits(self.cvEndJoint, tz=(0.01, 1), etz=(True, False))
     ctrls.setLockHide([self.cvEndJoint], ["tx", "ty", "rx", "ry", "rz", "sx", "sy", "sz"])
     # transform cvLocs in order to put as a good head guide:
     cmds.setAttr(self.cvNeckLoc + ".rotateY", -10)
     cmds.setAttr(self.cvHeadLoc + ".translateZ", 2)
     cmds.setAttr(self.cvHeadLoc + ".rotateY", 5)
     cmds.setAttr(self.cvJawLoc + ".translateX", -0.5)
     cmds.setAttr(self.cvJawLoc + ".translateZ", 1.25)
     cmds.setAttr(self.cvJawLoc + ".rotateY", -95)
     cmds.setAttr(self.cvChinLoc + ".translateZ", 0.25)
     cmds.setAttr(self.moduleGrp + ".rotateX", -90)
     cmds.setAttr(self.moduleGrp + ".rotateY", 90)
     # lip cvLocs:
     cmds.setAttr(self.cvLLipLoc + ".translateY", -0.5)
     cmds.setAttr(self.cvLLipLoc + ".translateZ", 1)
     self.lipMD = cmds.createNode("multiplyDivide", name=self.guideName + "_lip_MD")
     cmds.connectAttr(self.cvLLipLoc + ".translateX", self.lipMD + ".input1X", force=True)
     cmds.connectAttr(self.cvLLipLoc + ".translateY", self.lipMD + ".input1Y", force=True)
     cmds.connectAttr(self.cvLLipLoc + ".translateZ", self.lipMD + ".input1Z", force=True)
     cmds.connectAttr(self.lipMD + ".outputX", self.cvRLipLoc + ".translateX", force=True)
     cmds.connectAttr(self.lipMD + ".outputY", self.cvRLipLoc + ".translateY", force=True)
     cmds.connectAttr(self.lipMD + ".outputZ", self.cvRLipLoc + ".translateZ", force=True)
     cmds.setAttr(self.lipMD + ".input2Y", -1)
Exemple #3
0
 def createGuide(self, *args):
     Base.StartClass.createGuide(self)
     # Custom GUIDE:
     cmds.setAttr(self.moduleGrp+".moduleNamespace", self.moduleGrp[:self.moduleGrp.rfind(":")], type='string')
     # create cvJointLoc and cvLocators:
     self.cvFootLoc, shapeSizeCH = ctrls.cvJointLoc(ctrlName=self.guideName+"_foot", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     self.cvRFALoc, shapeSizeCH  = ctrls.cvLocator(ctrlName=self.guideName+"_RfA", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     self.cvRFBLoc, shapeSizeCH  = ctrls.cvLocator(ctrlName=self.guideName+"_RfB", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     self.cvRFCLoc, shapeSizeCH  = ctrls.cvLocator(ctrlName=self.guideName+"_RfC", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     self.cvRFDLoc, shapeSizeCH  = ctrls.cvLocator(ctrlName=self.guideName+"_RfD", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     self.cvRFELoc, shapeSizeCH  = ctrls.cvLocator(ctrlName=self.guideName+"_RfE", r=0.3)
     self.connectShapeSize(shapeSizeCH)
     # create jointGuides:
     self.jGuideFoot = cmds.joint(name=self.guideName+"_JGuideFoot", radius=0.001)
     self.jGuideRFE  = cmds.joint(name=self.guideName+"_JGuideRfE", radius=0.001)
     cmds.select(clear=True)
     self.jGuideRFA  = cmds.joint(name=self.guideName+"_JGuideRfA", radius=0.001)
     self.jGuideRFD  = cmds.joint(name=self.guideName+"_JGuideRfD", radius=0.001)
     self.jGuideRFB  = cmds.joint(name=self.guideName+"_JGuideRfB", radius=0.001)        
     self.jGuideRFC  = cmds.joint(name=self.guideName+"_JGuideRfC", radius=0.001)
     self.jGuideRFAC = cmds.joint(name=self.guideName+"_JGuideRfAC", radius=0.001)
     # set jointGuides as templates:
     cmds.setAttr(self.jGuideFoot+".template", 1)
     cmds.setAttr(self.jGuideRFA+".template", 1)
     cmds.setAttr(self.jGuideRFB+".template", 1)
     cmds.setAttr(self.jGuideRFC+".template", 1)
     cmds.setAttr(self.jGuideRFD+".template", 1)
     cmds.setAttr(self.jGuideRFE+".template", 1)
     cmds.parent(self.jGuideFoot, self.jGuideRFA, self.moduleGrp, relative=True)
     # create cvEnd:
     self.cvEndJoint, shapeSizeCH = ctrls.cvLocator(ctrlName=self.guideName+"_JointEnd", r=0.1)
     self.connectShapeSize(shapeSizeCH)
     cmds.parent(self.cvEndJoint, self.cvRFELoc)
     cmds.setAttr(self.cvEndJoint+".tz", 1.3)
     self.jGuideEnd = cmds.joint(name=self.guideName+"_JGuideEnd", radius=0.001)
     cmds.setAttr(self.jGuideEnd+".template", 1)
     cmds.parent(self.jGuideEnd, self.jGuideRFE)
     # make parents between cvLocs:
     cmds.parent(self.cvFootLoc, self.cvRFALoc, self.cvRFBLoc, self.cvRFCLoc, self.cvRFDLoc, self.moduleGrp)
     cmds.parent(self.cvRFELoc, self.cvFootLoc)
     # connect cvLocs in jointGuides:
     ctrls.directConnect(self.cvFootLoc, self.jGuideFoot, ['tx', 'ty', 'tz', 'rx', 'ry', 'rz'])
     cmds.parentConstraint(self.cvRFALoc, self.jGuideRFA, maintainOffset=False, name=self.jGuideRFA+"_ParentConstraint")
     cmds.parentConstraint(self.cvRFBLoc, self.jGuideRFB, maintainOffset=False, name=self.jGuideRFB+"_ParentConstraint")
     cmds.parentConstraint(self.cvRFCLoc, self.jGuideRFC, maintainOffset=False, name=self.jGuideRFC+"_ParentConstraint")
     cmds.parentConstraint(self.cvRFDLoc, self.jGuideRFD, maintainOffset=False, name=self.jGuideRFD+"_ParentConstraint")
     cmds.parentConstraint(self.cvRFELoc, self.jGuideRFE, maintainOffset=False, name=self.jGuideRFE+"_ParentConstraint")
     cmds.parentConstraint(self.cvRFALoc, self.jGuideRFAC, maintainOffset=False, name=self.jGuideRFAC+"_ParentConstraint")
     ctrls.directConnect(self.cvEndJoint, self.jGuideEnd, ['tx', 'ty', 'tz', 'rx', 'ry', 'rz'])
     # limit, lock and hide cvEnd:
     cmds.transformLimits(self.cvEndJoint, tz=(0.01, 1), etz=(True, False))
     ctrls.setLockHide([self.cvEndJoint], ['tx', 'ty', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz'])
     # transform cvLocs in order to put as a good foot guide:
     cmds.setAttr(self.cvFootLoc+".translateZ", 2)
     cmds.setAttr(self.cvFootLoc+".rotateY", -90)
     cmds.setAttr(self.cvRFELoc+".translateX", -1)
     cmds.setAttr(self.cvRFELoc+".translateZ", 2.5)
     cmds.setAttr(self.cvRFCLoc+".translateX", 1)
     cmds.setAttr(self.cvRFALoc+".translateX", -0.6)
     cmds.setAttr(self.cvRFALoc+".translateY", -1)
     cmds.setAttr(self.cvRFBLoc+".translateX", -0.6)
     cmds.setAttr(self.cvRFBLoc+".translateY", 1)
     cmds.setAttr(self.cvRFDLoc+".translateX", -3.5)
     cmds.setAttr(self.moduleGrp+".rotateX", -90)
     cmds.setAttr(self.moduleGrp+".rotateY", 90)