Esempio n. 1
0
 def rigBlendControl(self, _parent):
     # Move and parent blend control
     rc.orientControl(self.m_blendControl, _parent)
     group = rg.addGroup(self.m_blendControl, "%s_0" %(self.m_blendControl))
     moveValue = -2
     if self.m_isMirrored:
         moveValue *= -1
     cmds.setAttr("%s.t%s" %(self.m_blendControl, self.m_twistAxis), moveValue)
     cmds.parentConstraint(_parent, group, mo=1)
     rc.lockAttrs(
         self.m_blendControl, 
         [
             "tx", 
             "ty",
             "tz", 
             "rx", 
             "ry", 
             "rz", 
             "sx", 
             "sy", 
             "sz", 
             "visibility"
         ],
         True,
         True
         )
Esempio n. 2
0
 def __init__(
         self,
         _sceneData, 
         _name,
         _baseName,
         _joints,
         _toePivot,
         _heelPivot,
         _insidePivot,
         _outsidePivot,
         _footMain,
         _ankleIK
         ):
     self.m_sceneData = _sceneData
     self.m_name = _name
     self.m_baseName = _baseName
     self.m_group = cmds.group(n="%s_GRP" %(self.m_name), em=True)
     self.m_joints = _joints
     jointGroup = rg.addGroup(self.m_joints[0], "%s_0" %(self.m_joints[0]))
     cmds.parent(jointGroup, self.m_group)
     self.m_toePivotLoc = _toePivot
     self.m_heelPivotLoc = _heelPivot
     self.m_insidePivotLoc = _insidePivot
     self.m_outsidePivotLoc = _outsidePivot
     self.m_footMainLoc = _footMain
     self.m_ankleIK = _ankleIK
     self.m_allControls = {}
Esempio n. 3
0
    def generate(self):
        self.m_fingers = []
        names = ["indexFing", "middleFing", "ringFing", "pinkyFing", "thumb"]
        for i in range(len(names)):
            thumb = False
            if i == (len(names) - 1):
                thumb = True
            newFinger = fing.FingerRig(
                "%s_%s" %(self.m_name, names[i]),
                self.m_handJoints.getFinger(i),
                thumb
                )
            newFinger.generate()
            cmds.parent(newFinger.getGroup(), self.m_group)
            self.m_fingers.append(newFinger)

        #create control
        self.m_control = cmds.spaceLocator(n="%s_CTRL" %(self.m_name))[0]


        rc.orientControl(self.m_control, self.m_fingers[3].getKnuckle())
        group = rg.addGroup(self.m_control, "%s_0" %(self.m_control))
        rc.lockAttrs(self.m_control, ["tx", "rotate", "scale"], True, False)
        cmds.parent(group, self.m_group)
        cmds.expression(n="%s_EXP" %(self.m_name), s=self.createExp())
Esempio n. 4
0
    def __init__(
            self, 
            _sceneData,
            _joints,
            _name,
            _baseName,
            _controlObject,
            _numUpperControls,
            _numLowerControls,
            _numUpperJoints,
            _numLowerJoints,
            _upperStretchJoint,
            _lowerStretchJoint,
            _isMirrored=False,
            _twistAxis = "y",
            _rigWrist = True,
            ):
        self.m_sceneData = _sceneData
        self.m_isMirrored = _isMirrored
        self.m_joints = aj.ArmJoints(_joints)
        self.m_name = _name
        self.m_baseName = _baseName
        self.m_controlObject = _controlObject
        self.m_twistAxis = _twistAxis
        self.m_rigWrist = _rigWrist
        tmp = rg.stripMiddle(self.m_joints.m_shoulder, 0, 3)
        self.m_group = self.m_name+"_GRP"
        self.m_group = cmds.group(n=self.m_group, em=1)
        cmds.parent(self.m_joints.m_shoulder, self.m_group, r=1)
        #Add transform group
        self.m_mainTransform = rg.addGroup(
            self.m_joints.m_shoulder, 
            "%s_0" %(self.m_joints.m_shoulder)
            )
        self.m_allControls = {}
        self.m_isGenerated = False
        self.m_elbowTwistJoints = []

        # stretch chain parameters
        self.m_numUpperControls = _numUpperControls
        self.m_numLowerControls = _numLowerControls
        self.m_numUpperJoints = _numUpperJoints
        self.m_numLowerJoints = _numLowerJoints
        self.m_upperStretchJoints = _upperStretchJoint
        self.m_lowerStretchJoints = _lowerStretchJoint
Esempio n. 5
0
 def __init__(
         self,
         _sceneData,
         _name,
         _baseName,
         _joints,
         _footMain,
         _parent
         ):
     self.m_sceneData = _sceneData
     self.m_name = _name
     self.m_baseName = _baseName
     self.m_group = cmds.group(n="%s_GRP" %(self.m_name), em=True)
     self.m_joints = _joints
     self.m_footMain = _footMain
     self.m_parent = _parent
     self.m_allControls = {}
     jointGroup = rg.addGroup(self.m_joints[0], "%s_0" %(self.m_joints[0]))
     cmds.parent(jointGroup, self.m_group)
     self.m_ankleGenerated = False
     self.m_toeGenerated = False
Esempio n. 6
0
def generateAutoClav(_name, _shoulderSDK, _wristIK):
	print "doing something"
	error.assertString(_name)
	error.assertMayaObject(_shoulderSDK)
	error.assertMayaObject(_wristIK)
	cmds.select(clear=True)

	# Create joints
	joint1 = cmds.joint(n="%s_IK_JNT" %(_name))
	rc.copyTranslation(joint1, _shoulderSDK)
	joint2 = cmds.joint(n="%s_IKEND_JNT" %(_name))
	rc.copyTranslation(joint2, _wristIK)
	#cmds.parent(joint2, joint1)

	# Create IK
	ikControl = cmds.ikHandle(
		n="%s_IK" %(_name),
		sol="ikRPsolver",
		sj= joint1,
		ee=joint2
		)[0]
	# deselect so we don't get warnings
	cmds.select(d=1)

	# Create pole vec
	locator = cmds.spaceLocator(n="%s_up_LOC" %(_name))[0]
	rc.orientControl(locator, _wristIK)
	locGroup = rg.addGroup(locator, "%s_0" %(locator))
	cmds.setAttr("%s.ty" %(locator), 2)

	cmds.poleVectorConstraint(locator, ikControl)

	# Connect up to rig
	cmds.pointConstraint(_wristIK, locGroup, mo=1)
	cmds.pointConstraint(_wristIK, ikControl, mo=1)

	cmds.orientConstraint(joint1, _shoulderSDK, mo=1)