def RMCreateClavicleJointStructure(self, ClavRefPnts): rootClavicle, ClavicleJoints = RMRigTools.RMCreateBonesAtPoints( ClavRefPnts, ZAxisOrientation="z") self.NameConv.rename_set_from_name(ClavicleJoints[1], "clavicle", "name") pm.parent(rootClavicle, self.chestJoint) return rootClavicle, ClavicleJoints
def RMCreateSpineJointStructure(self, SpineRef): rootSpine, joints = RMRigTools.RMCreateBonesAtPoints( SpineRef, ZAxisOrientation="z") SpineLength = RMRigTools.RMPointDistance(joints[0], joints[len(joints) - 1]) chestJoint = pm.joint(name="chest") self.NameConv.rename_name_in_format(chestJoint, name=chestJoint) RMRigTools.RMAlign(joints[len(joints) - 1], chestJoint, 3) #pm.parent(chestJoint, joints[len(joints)-1]) pm.makeIdentity(chestJoint, apply=True, r=False, t=True, s=True, n=0) pm.xform(chestJoint, t=[SpineLength / 4, 0, 0], os=True, relative=True) return rootSpine, joints, chestJoint
def createFKControlsOnListPoints(self, ListPoints, controlShape="cube"): self.rootJoints, jointArray = RMRigTools.RMCreateBonesAtPoints(ListPoints) index = 0 for eachJoint in jointArray[:-1]: if controlShape == "cube": ResetGroup, Ctrl = self.ShapeControls.RMCreateBoxCtrl(eachJoint) else: ResetGroup, Ctrl = self.ShapeControls.RMCircularControl(eachJoint) if index == 0: self.rootControls = ResetGroup prevControl = Ctrl else: cmds.parent(ResetGroup, prevControl) prevControl = Ctrl self.controls.append(Ctrl) cmds.parentConstraint(Ctrl, eachJoint, mo=False) index += 1
def RMCreateBonesBetweenPoints(self, InitialPoint, FinalPoint, NumberOfTB, AlignObject=None): DirectionVector = FinalPoint-InitialPoint TotalLength = DirectionVector.length() Step = TotalLength / NumberOfTB StepVector = DirectionVector.normal() * Step locatorsList = [] for count in range(0, NumberOfTB + 1): Locator = pm.spaceLocator() if AlignObject: if self.NameConv.is_name_in_format(AlignObject): self.NameConv.rename_based_on_base_name(AlignObject, Locator, name='TwistJoint%s' % (self.NameConv.get_from_name(AlignObject,"name").capitalize()))#.capitalize() locatorsList.append(Locator) pm.xform(Locator, translation=list(InitialPoint+(StepVector*count)), worldSpace=True) RMRigTools.RMAlign(AlignObject, Locator, 2) self.TwistResetJoints, self.TwistJoints = RMRigTools.RMCreateBonesAtPoints(locatorsList) self.deleteList(locatorsList) return self.TwistResetJoints, self.TwistJoints
def RMCreateHipJointStructure(self, HipRefPnts): rootHip, hipJoints = RMRigTools.RMCreateBonesAtPoints( HipRefPnts, ZAxisOrientation="z") self.NameConv.rename_set_from_name(hipJoints, "Thehip", "name") self.NameConv.rename_set_from_name(hipJoints, "hip", "name") return rootHip, hipJoints