Exemple #1
0
    def _handleRaiseBtn(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.

        """
        cmds.currentTime(self.timeBox.value(), edit=True)
        arm_l = findName("arm_L")
        limbRotate(arm_l, 20, -140) 
        self.frameDisplay.display(self.timeBox.value() + 20)
Exemple #2
0
    def _handleRaiseBtn(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.

        """
        cmds.currentTime(self.timeBox.value(), edit=True)
        arm_l = findName("arm_L")
        limbRotate(arm_l, 20, -140)
        self.frameDisplay.display(self.timeBox.value() + 20)
Exemple #3
0
 def _handleKickBtn(self):
     """
     This callback creates a polygonal cylinder in the Maya scene.
     
     """
     cmds.currentTime(self.timeBox.value(), edit=True)
     limb = findName("leg_R")
     limbRotate(limb, 10, 35)
     cmds.currentTime(self.timeBox.value() + 10, edit=True)
     limbRotate(limb, 15, -100) 
     self.frameDisplay.display(self.timeBox.value() + 35)
Exemple #4
0
 def _handleKickBtn(self):
     """
     This callback creates a polygonal cylinder in the Maya scene.
     
     """
     cmds.currentTime(self.timeBox.value(), edit=True)
     limb = findName("leg_R")
     limbRotate(limb, 10, 35)
     cmds.currentTime(self.timeBox.value() + 10, edit=True)
     limbRotate(limb, 15, -100)
     self.frameDisplay.display(self.timeBox.value() + 35)
Exemple #5
0
    def _handleRunBtn(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.
        
        """
        #first we raise the leg, then halfway through the leg raise, we start jumping a bit, and raise the back leg in reverse
        currTime = self.timeBox.value()
        changeTime = (self.distBox.value()*10)
        endTime = currTime + changeTime
        cmds.currentTime(currTime, edit=True)
        RArm = findName("arm_R")
        LArm = findName("arm_L")
        arm = ""
        leg = ""
        R = findName("leg_R")
        L = findName("left_L")
        bod = findName("body")
        
        
        #we start by beginning the X/Z translation keys at the same time
        cmds.currentTime(currTime, edit=True)
        bAlter(bod, changeTime, self._getX(), "translateX")
        cmds.currentTime(currTime, edit=True)
        bAlter(bod, changeTime, self._getZ(), "translateZ")
        #then, while currTime < endTime, move the legs, hop up and down.
        while (currTime < endTime):
            #move the right leg up
            limbRotate(R, 10, -60) 
            #while doing so, move the left arm up
            cmds.currentTime(currTime, edit=True)
            limbRotate(LArm, 10, -60)   
            #while doing so, move the right arm slightly back
            cmds.currentTime(currTime, edit=True)
            limbRotate(RArm, 10, 30)
            #while doings so, move the left leg slightly back
            cmds.currentTime(currTime, edit=True)
            limbRotate(L, 10, 30)        
            #meanwhile, we also need to start hopping.
            cmds.currentTime(currTime, edit=True)
            bAlter(bod, 10, 1, "translateY")
            currTime += 10            
            #move the right leg down
            limbRotate(R, 10, 60) 
            #while doing so, move the left arm down
            cmds.currentTime(currTime, edit=True)
            limbRotate(LArm, 10, 60)   
            #while doing so, move the right arm back forward
            cmds.currentTime(currTime, edit=True)
            limbRotate(RArm, 10, -30)
            #while doings so, move the left leg back forward
            cmds.currentTime(currTime, edit=True)
            limbRotate(L, 10, -30)    
            #no we're at the peak, everything back to neutral
            cmds.currentTime(currTime, edit=True)
            bAlter(bod, 10, -1, "translateY")
            currTime += 10
            arm = RArm
            RArm = LArm
            LArm = arm

            leg = R
            R = L
            L = leg
        self.frameDisplay.display(endTime)
Exemple #6
0
    def _handleRunBtn(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.
        
        """
        #first we raise the leg, then halfway through the leg raise, we start jumping a bit, and raise the back leg in reverse
        currTime = self.timeBox.value()
        changeTime = (self.distBox.value() * 10)
        endTime = currTime + changeTime
        cmds.currentTime(currTime, edit=True)
        RArm = findName("arm_R")
        LArm = findName("arm_L")
        arm = ""
        leg = ""
        R = findName("leg_R")
        L = findName("left_L")
        bod = findName("body")

        #we start by beginning the X/Z translation keys at the same time
        cmds.currentTime(currTime, edit=True)
        bAlter(bod, changeTime, self._getX(), "translateX")
        cmds.currentTime(currTime, edit=True)
        bAlter(bod, changeTime, self._getZ(), "translateZ")
        #then, while currTime < endTime, move the legs, hop up and down.
        while (currTime < endTime):
            #move the right leg up
            limbRotate(R, 10, -60)
            #while doing so, move the left arm up
            cmds.currentTime(currTime, edit=True)
            limbRotate(LArm, 10, -60)
            #while doing so, move the right arm slightly back
            cmds.currentTime(currTime, edit=True)
            limbRotate(RArm, 10, 30)
            #while doings so, move the left leg slightly back
            cmds.currentTime(currTime, edit=True)
            limbRotate(L, 10, 30)
            #meanwhile, we also need to start hopping.
            cmds.currentTime(currTime, edit=True)
            bAlter(bod, 10, 1, "translateY")
            currTime += 10
            #move the right leg down
            limbRotate(R, 10, 60)
            #while doing so, move the left arm down
            cmds.currentTime(currTime, edit=True)
            limbRotate(LArm, 10, 60)
            #while doing so, move the right arm back forward
            cmds.currentTime(currTime, edit=True)
            limbRotate(RArm, 10, -30)
            #while doings so, move the left leg back forward
            cmds.currentTime(currTime, edit=True)
            limbRotate(L, 10, -30)
            #no we're at the peak, everything back to neutral
            cmds.currentTime(currTime, edit=True)
            bAlter(bod, 10, -1, "translateY")
            currTime += 10
            arm = RArm
            RArm = LArm
            LArm = arm

            leg = R
            R = L
            L = leg
        self.frameDisplay.display(endTime)