def _handleCreateBall(self):
     cmds.polySphere(name='ball', r=2, sx=20, sy=20, ax=[0, 1, 0])
     cmds.polyColorPerVertex(rgb=(1, 1, 1), cdo=True)
     cmds.select('ball.f[380:399]', 'ball.f[320:339]', 'ball.f[280:299]', 'ball.f[240:259]', 'ball.f[200:219]', 'ball.f[160:179]', 'ball.f[120:139]', 'ball.f[80:99]', 'ball.f[40:59]', 'ball.f[0:19]')
     cmds.polyColorPerVertex(rgb=(1, 0, 0), cdo=True)
     cmds.select('ball')
     cmds.nonLinear( type='squash')
    def _handleArm(self):
        time.sleep(2)

        ctime = cmds.currentTime(query=True)

        cmds.select('arm_L')

        cmds.setAttr('arm_L.rx', 0)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 10)
        cmds.setAttr('arm_L.rx', -90)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 15)
        cmds.setAttr('arm_L.rx', -180)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 25)
        cmds.setAttr('arm_L.rx', -180)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 35)
        cmds.setAttr('arm_L.rx', 0)
        cmds.setKeyframe()
Esempio n. 3
0
    def _handleExampleButton(self):
        time = 120
        d = cmds.polyCylinder(r=15,
                              h=20,
                              sx=40,
                              sy=10,
                              sz=1,
                              ax=(0, 0, 0),
                              rcp=0,
                              cuv=2,
                              ch=1,
                              n='CylinderContainer')[0]
        cmds.move(0, 10, 0)

        cmds.select(d)

        response = nimble.createRemoteResponse(globals())
        response.put('name', d)
        num = self.NumBubbles.value()
        bubble = "bubble"
        for i in range(num):

            randomX = random.randrange(-10, 10)
            randomY = random.randrange(1, 2)
            randomZ = random.randrange(-10, 10)
            circleShape(randomX, randomY, randomZ, bubble, 1, None, time)
            bubble = "bubble" + str(i)
Esempio n. 4
0
    def _createGeometry(self, name, side):

        #build toe
        self.side = side
        self.name = name
        self.toe = mc.polyCube(sx=2,
                               sy=2,
                               sz=2,
                               w=5,
                               h=2,
                               d=3,
                               n=name + '_toe')[0]
        self.ball = mc.polyCylinder(h=5, n=name + '_ball')[0]
        mc.move(0, 0, -2, r=True)
        mc.rotate(0, 0, '90deg')
        self.toe = mc.polyUnite(self.toe, self.ball, n=name + '_toe')[0]
        mc.move(0, 0, -2, self.toe + ".scalePivot", self.toe + ".rotatePivot")

        #build arch
        self.arch = mc.polyCube(w=5, d=10, n=name + '_arch')[0]
        mc.move(0, 0, -7, r=True)

        #mc.select(f[8]-f[11])
        mc.select(self.arch + '.f[2]')
        mc.move(0, 3, 0, r=True)

        self.ankle = mc.polySphere(r=2.5)[0]
        mc.move(0, 3, -12, r=True)

        self.arch = mc.polyUnite(self.arch, self.ankle, n=name + '_arch')[0]

        mc.move(0, 3, -12, self.arch + ".scalePivot",
                self.arch + ".rotatePivot")
        #self.heal = mc.polyCube(sx=2, sy=2, sz=2,w=5, h=3, n=name+'_heal')
        pass
Esempio n. 5
0
    def _handleRun(self):
        def rotate_limbs(angle):

            cmds.select('arm_L')
            cmds.setAttr('arm_L.rx', angle)
            cmds.setKeyframe(at='rotateX')

            cmds.select('arm_R')
            cmds.setAttr('arm_R.rx', -angle)
            cmds.setKeyframe(at='rotateX')

            cmds.select('left_L')
            cmds.setAttr('left_L.rx', -angle)
            cmds.setKeyframe(at='rotateX')

            cmds.select('leg_R')
            cmds.setAttr('leg_R.rx', angle)
            cmds.setKeyframe(at='rotateX')

        def change_height(height):

            cmds.select('Lego_Group')
            cmds.setAttr('Lego_Group.ty', height)
            cmds.setKeyframe(at='translateY')

        ctime = cmds.currentTime(query=True)

        cmds.select('Lego_Group')
        cmds.setAttr('Lego_Group.tz', 0)
        cmds.setKeyframe(at='translateZ')

        for index in range(1, 5):

            rotate_limbs(0)
            change_height(0)

            ctime += 5
            cmds.currentTime(ctime)
            rotate_limbs(90)
            change_height(3)

            ctime += 5
            cmds.currentTime(ctime)
            rotate_limbs(0)
            change_height(0)

            ctime += 5
            cmds.currentTime(ctime)
            rotate_limbs(-90)
            change_height(3)

            ctime += 5
            cmds.currentTime(ctime)

        rotate_limbs(0)
        change_height(0)

        cmds.select('Lego_Group')
        cmds.setAttr('Lego_Group.tz', 65)
        cmds.setKeyframe(at='translateZ')
def runFrom(bodyName, startTime, endTime):        
    mc.select(bodyName)
    #first we start 
    mc.currentTime(startTime+24)
    mc.setKeyframe(attribute='translateZ', v=-60)
    mc.currentTime(endTime)
    mc.setKeyframe(attribute='translateZ', v=0)

    mc.currentTime(startTime)
    mc.setKeyframe(attribute='rotateX', v=0)
    mc.currentTime(startTime+24)
    mc.setKeyframe(attribute='rotateX', v=385)    
    mc.currentTime(endTime-24)
    mc.setKeyframe(attribute='rotateX', v=385)     
    mc.currentTime(endTime)
    mc.setKeyframe(attribute='rotateX', v=360)
     
    left_leg = findName('leg_R')
    right_leg = findName('left_L')
    rTime = startTime
    lTime = startTime + 6 
    startVal = 0
    while (lTime+12) < endTime:
        rTime = rTime + 12
        lTime = lTime + 12
        legRotate(right_leg, rTime, rTime+12, startVal, startVal + 360)
        legRotate(left_leg, lTime, lTime+12, startVal, startVal+360)
        startVal = startVal + 360
    mc.select(right_leg)
    mc.currentTime(endTime+1)
    mc.rotate(0,0,0)
    mc.currentTime(startTime)
Esempio n. 7
0
    def _handleBall(self):

        power = self.powerBox.value()

        ctime = cmds.currentTime(query=True)

        cmds.select('ball')

        cmds.setAttr('ball.ty', 0)
        cmds.setAttr('ball.tz', 0)
        cmds.setAttr('ball.rx', 0)
        cmds.setAttr('ball.ry', 0)
        cmds.setAttr('ball.rz', 0)
        cmds.setKeyframe()
        cmds.keyTangent('ball',
                        inTangentType='linear',
                        outTangentType='linear',
                        time=(ctime, ctime))

        ctime += 5 * power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 2 * power)
        cmds.setKeyframe(at='translateY')

        ctime += 5 * power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0)
        cmds.setKeyframe(at='translateY')
        #cmds.keyTangent('ball', inTangentType='linear', outTangentType='linear', time=(ctime,ctime))

        ctime += 3 * power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 1.5 * power)
        cmds.setKeyframe(at='translateY')

        ctime += 3 * power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0)
        cmds.setKeyframe(at='translateY')
        #cmds.keyTangent('ball', inTangentType='linear', outTangentType='linear', time=(ctime,ctime))

        ctime += power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0.5 * power)
        cmds.setKeyframe(at='translateY')

        ctime += power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0)
        cmds.setKeyframe(at='translateY')
        #cmds.keyTangent('ball', inTangentType='linear', outTangentType='linear', time=(ctime,ctime))

        ctime += power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.tz', 16 * power)
        cmds.setAttr('ball.ty', 0)
        cmds.setAttr('ball.rx', 300 * power)
        cmds.setAttr('ball.ry', 240 * power)
        cmds.setAttr('ball.rz', 240 * power)
        cmds.setKeyframe()
    def _handlePerturb(self):
        """
        This perturbs the selected object.

        """

        selectedObjects = cmds.ls(selection=True, long=True)

        vertsList = []
        for object in selectedObjects:
            totalVerts = cmds.polyEvaluate(object, vertex=True)

            for number in range(totalVerts):
                vertsList.append(object +
                                 '.vtx[{number}]'.format(number=number))

        for vert in vertsList:
            min = float(self.minInput.displayText())
            max = float(self.maxInput.displayText())
            randNumX = random.uniform(min, max)
            randNumY = random.uniform(min, max)
            randNumZ = random.uniform(min, max)
            cmds.select(vert, replace=True)
            cmds.move(randNumX, randNumY, randNumZ, relative=True)
            cmds.select(selectedObjects, replace=True)
Esempio n. 9
0
 def _handleChromeTex(self):
     if materials.npchromeSG == None:
         materials.npchrome()
     Sphere = mc.polySphere(r=5, n='texChromephere')[0]
     mc.select(cl=True)
     mc.select(Sphere)
     mc.sets(e=True, forceElement=materials.npchromeSG)
Esempio n. 10
0
 def _handlePlasticBlue(self):
     if materials.blueCPlasticSG == None:
         materials.blueClearPlastic()
     Sphere = mc.polySphere(r=5, n='bluePlasticSphere')[0]
     mc.select(cl=True)
     mc.select(Sphere)
     mc.sets(e=True, forceElement=materials.blueCPlasticSG)
Esempio n. 11
0
 def _handleShinyGold(self):
     if materials.shinyGoldSG == None:
         materials.shinyGold()
     Sphere = mc.polySphere(r=5, n='shinyGoldSphere')[0]
     mc.select(cl=True)
     mc.select(Sphere)
     mc.sets(e=True, forceElement=materials.shinyGoldSG)
Esempio n. 12
0
 def _handleSilver(self):
     if materials.silverSG == None:
         materials.silver()
     Sphere = mc.polySphere(r=5, n='sliverSphere')[0]
     mc.select(cl=True)
     mc.select(Sphere)
     mc.sets(e=True, forceElement=materials.silverSG)
Esempio n. 13
0
 def _handleBlueAA(self):
     if materials.blueAASG == None:
         materials.blueAnodizedAluminum()
     Sphere = mc.polySphere(r=5, n='blueAASphere')[0]
     mc.select(cl=True)
     mc.select(Sphere)
     mc.sets(e=True, forceElement=materials.blueAASG)
Esempio n. 14
0
 def _handleBlueFM(self):
     if materials.blueFMSG == None:
         materials.blueFineMetallic()
     Sphere = mc.polySphere(r=5, n='blueFMSphere')[0]
     mc.select(cl=True)
     mc.select(Sphere)
     mc.sets(e=True, forceElement=materials.blueFMSG)
Esempio n. 15
0
    def _handleBubbleButton(self):
        """
        This callback creates a polygonal sphere in the Maya scene.
        it then translates it.
        """
        decRange = np.arange(-1,1,.1)
        decRange2 = np.arange(0,1,.1)
        r = 2
        a = 2.0*r
        y = (0, 1, 0) # y up
        c = cmds.polySphere(
            r=r, sx=10, sy=10, ax=y, cuv=2, ch=1, n='Bubble')[0]
        cmds.select(c)
        cmd.setKeyframe()

        cmd.setKeyframe()
        for i in range(1,300,5):
            x = rand.choice(decRange)
            y = 5*rand.choice(decRange2)
            z = rand.choice(decRange)
            cmd.currentTime(i)
            cmd.move(x,y,z,r=True)
            cmd.setKeyframe()
        response = nimble.createRemoteResponse(globals())
        response.put('name', c)
def runFrom(bodyName, startTime, endTime):        
    mc.select(bodyName)
    #first we start 
    mc.currentTime(startTime+24)
    mc.setKeyframe(attribute='translateZ', v=-60)
    mc.currentTime(endTime)
    mc.setKeyframe(attribute='translateZ', v=0)

    mc.currentTime(startTime)
    mc.setKeyframe(attribute='rotateX', v=0)
    mc.currentTime(startTime+24)
    mc.setKeyframe(attribute='rotateX', v=385)    
    mc.currentTime(endTime-24)
    mc.setKeyframe(attribute='rotateX', v=385)     
    mc.currentTime(endTime)
    mc.setKeyframe(attribute='rotateX', v=360)
     
    left_leg = findName('leg_R')
    right_leg = findName('left_L')
    rTime = startTime
    lTime = startTime + 6 
    startVal = 0
    while (lTime+12) < endTime:
        rTime = rTime + 12
        lTime = lTime + 12
        legRotate(right_leg, rTime, rTime+12, startVal, startVal + 360)
        legRotate(left_leg, lTime, lTime+12, startVal, startVal+360)
        startVal = startVal + 360
    mc.select(right_leg)
    mc.currentTime(endTime+1)
    mc.rotate(0,0,0)
    mc.currentTime(startTime)
Esempio n. 17
0
 def _handleRedAA(self):
     if materials.redAASG == None:
         materials.redAnodizedAluminum()
     print materials.redAASG
     Sphere = mc.polySphere(r=5, n='redAASphere')[0]
     mc.select(cl=True)
     mc.select(Sphere)
     mc.sets(e=True, forceElement=materials.redAASG)
Esempio n. 18
0
 def _perturb(self, selectObj):
     cmds.select(selectObj)
     total = cmds.polyEvaluate(v=True)
     for i in range(0, total):
         x = random.uniform(0, 0.7)
         y = random.uniform(0, 0.7)
         z = random.uniform(0, 0.7)
         cmds.polyMoveVertex(selectObj+'.vtx['+str(i)+']', lt=[x, y, z])
Esempio n. 19
0
 def moveFemur(self, xrotate, yrotate, zrotate):
     femur = self.getGundamFemur()
     mc.select(femur[0])
     mc.rotate(xrotate, yrotate, zrotate)
     mc.setKeyframe(femur[0], t=self.timel)
     mc.select(femur[1])
     mc.rotate(xrotate, yrotate, zrotate)
     mc.setKeyframe(femur[1], t=self.timel)
Esempio n. 20
0
 def moveFeet(self, xrotate, yrotate, zrotate):
     feets = self.getGundamFeet()
     mc.select(feets[0])
     mc.rotate(xrotate, yrotate, zrotate)
     mc.setKeyframe(feets[0], t=self.timel)
     mc.select(feets[1])
     mc.rotate(xrotate, yrotate, zrotate)
     mc.setKeyframe(feets[1], t=self.timel)
def bAlter(bName, timeFrame, changeVal, chStr):
    mc.select(bName)    
    startTime = mc.currentTime(query=True)
    endTime = startTime + timeFrame
    rotBy = mc.getAttr(bName+ "." + chStr) + changeVal
    mc.setKeyframe(attribute=chStr)
    mc.currentTime(endTime)
    mc.setKeyframe(attribute=chStr, v=rotBy)
Esempio n. 22
0
 def moveHip(self, xrotate, yrotate, zrotate):
     hips = self.getGundamHip()
     mc.select(hips[0])
     mc.rotate(-xrotate, yrotate, zrotate)
     mc.setKeyframe(hips[0], t=self.timel)
     mc.select(hips[1])
     mc.rotate(-xrotate, -yrotate, zrotate)
     mc.setKeyframe(hips[1], t=self.timel)
    def _handleBall(self):

        power = self.powerBox.value()

        ctime = cmds.currentTime(query=True)

        cmds.select('ball')

        cmds.setAttr('ball.ty', 0)
        cmds.setAttr('ball.tz', 0)
        cmds.setAttr('ball.rx', 0)
        cmds.setAttr('ball.ry', 0)
        cmds.setAttr('ball.rz', 0)
        cmds.setKeyframe()
        cmds.keyTangent('ball', inTangentType='linear', outTangentType='linear',
                       time=(ctime,ctime))

        ctime += 5*power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 2*power)
        cmds.setKeyframe(at='translateY')

        ctime += 5*power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0)
        cmds.setKeyframe(at='translateY')
        #cmds.keyTangent('ball', inTangentType='linear', outTangentType='linear', time=(ctime,ctime))

        ctime += 3*power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 1.5*power)
        cmds.setKeyframe(at='translateY')

        ctime += 3*power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0)
        cmds.setKeyframe(at='translateY')
        #cmds.keyTangent('ball', inTangentType='linear', outTangentType='linear', time=(ctime,ctime))

        ctime += power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0.5*power)
        cmds.setKeyframe(at='translateY')

        ctime += power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.ty', 0)
        cmds.setKeyframe(at='translateY')
        #cmds.keyTangent('ball', inTangentType='linear', outTangentType='linear', time=(ctime,ctime))

        ctime += power
        cmds.currentTime(ctime)
        cmds.setAttr('ball.tz', 16*power)
        cmds.setAttr('ball.ty', 0)
        cmds.setAttr('ball.rx', 300*power)
        cmds.setAttr('ball.ry', 240*power)
        cmds.setAttr('ball.rz', 240*power)
        cmds.setKeyframe()
Esempio n. 24
0
    def _CreateSphereButton(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.

        """
        sphere = cmds.polySphere(r=50.0, name='sphere1')
        cmds.select(sphere)
        response = nimble.createRemoteResponse(globals())
        response.put('name', sphere)
 def _makeCyl(self):
     r = 50
     a = 2.0*r
     y = (0, 1, 0)
     c = cmds.polyCylinder(
         r=r, h=5, sx=40, sy=1, sz=1, ax=y, rcp=0, cuv=2, ch=1, n='exampleCylinder')[0]
     cmds.select(c)
     response = nimble.createRemoteResponse(globals())
     response.put('name', c)
def bAlter(bName, timeFrame, changeVal, chStr):
    mc.select(bName)    
    startTime = mc.currentTime(query=True)
    endTime = startTime + timeFrame
    rotBy = mc.getAttr(bName+ "." + chStr) + changeVal
    mc.setKeyframe(attribute=chStr)
    mc.currentTime(endTime)
    mc.setKeyframe(attribute=chStr, v=rotBy)	
    mc.currentTime(startTimeTime)
Esempio n. 27
0
    def _CreateCubeButton(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.

        """
        cube = cmds.polyCube(w=50,h=50,d=50,name="cube1")
        cmds.select(cube)
        response = nimble.createRemoteResponse(globals())
        response.put('name', cube)
Esempio n. 28
0
    def _CreateCubeButton(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.

        """
        cube = cmds.polyCube(w=50, h=50, d=50, name="cube1")
        cmds.select(cube)
        response = nimble.createRemoteResponse(globals())
        response.put('name', cube)
Esempio n. 29
0
    def _CreateSphereButton(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.

        """
        sphere = cmds.polySphere(r=50.0, name='sphere1')
        cmds.select(sphere)
        response = nimble.createRemoteResponse(globals())
        response.put('name', sphere)
Esempio n. 30
0
    def _createJoints(self, side):

        mc.select(cl=True)
        self.j_thumb_1 = mc.joint(p=(self.sideModifyer*2.25,-1.5,1.25))

        mc.select(cl=True)

        mc.parent(self.r_hand_n_t, self.j_thumb_1)
        pass
Esempio n. 31
0
    def createLayer(self, layer, useExisting =True):
        """ Creates a display layer with the specified name. """

        if useExisting and cmds.objExists(layer):
            return

        priorSelection = MayaUtils.getSelectedTransforms()
        cmds.select(clear=True)
        cmds.createDisplayLayer(name=layer)
        MayaUtils.setSelection(priorSelection)
def doSecond():
    filePath = "C:/Users/Kyle/Downloads/x_wing/x_wing.mb"

    cmds.file(filePath, type='mayaBinary', ra=True, mergeNamespacesOnClash=False, namespace='x_wing', i=True )
    cmds.select('x_wing:polySurface3')
    cmds.scale(.1,.1,.1)
    cmds.move(0,10,10)
    cmds.setKeyframe(time=1)
    cmds.move(0,10,-10)
    cmds.setKeyframe(time=120)
Esempio n. 33
0
    def selectTrack(self, track, setFocus =True):
        """ Select the node corresponding to this track model instance, then
            focus the camera upon this node. """

        if track:
            node = self.getTrackNode(track)
            cmds.select(node)
            if setFocus:
                self.setCameraFocus()
        else:
            cmds.select(clear=True)
Esempio n. 34
0
 def handleEyebrowsDwnBtn(self):
     global eyebrowsActAmt
     global eyebrowsIncAmt
     btmCapAmt = -0.014
     cmds.select("eyebrowsClusterHandle")
     eyebrowsActAmt -= eyebrowsIncAmt
     if eyebrowsActAmt >= btmCapAmt:
         print eyebrowsActAmt
         cmds.move(0, eyebrowsActAmt, 0)
     else:
         eyebrowsActAmt = btmCapAmt
Esempio n. 35
0
 def handleDownBtn(self):
     global smileActAmt
     global incAmt
     btmCapAmt = -0.032
     cmds.select("smileClusterHandle")
     smileActAmt -= incAmt
     if smileActAmt >= btmCapAmt:
         print smileActAmt
         cmds.move(0, smileActAmt, 0)
     else:
         smileActAmt = btmCapAmt
Esempio n. 36
0
 def handleUpBtn(self):
     global smileActAmt
     global incAmt
     topCapAmt = 0.016
     cmds.select("smileClusterHandle")
     smileActAmt += incAmt
     if smileActAmt <= topCapAmt:
         print smileActAmt
         cmds.move(0, smileActAmt, 0)
     else:
         smileActAmt = topCapAmt
Esempio n. 37
0
 def handleSchnauzUpBtn(self):
     global schnauzActAmt
     global incAmt
     topCapAmt = 0.028
     cmds.select("schnauzClusterHandle")
     schnauzActAmt += incAmt
     if schnauzActAmt <= topCapAmt:
         print schnauzActAmt
         cmds.move(0, schnauzActAmt, 0)
     else:
         schnauzActAmt = topCapAmt
Esempio n. 38
0
 def handleEyebrowsUpBtn(self):
     global eyebrowsActAmt
     global eyebrowsIncAmt
     topCapAmt = 0.021
     cmds.select("eyebrowsClusterHandle")
     eyebrowsActAmt += eyebrowsIncAmt
     if eyebrowsActAmt <= topCapAmt:
         print eyebrowsActAmt
         cmds.move(0, eyebrowsActAmt, 0)
     else:
         eyebrowsActAmt = topCapAmt
Esempio n. 39
0
 def handleSchnauzDownBtn(self):
     global schnauzActAmt
     global incAmt
     btmCapAmt = 0.000
     cmds.select("schnauzClusterHandle")
     schnauzActAmt -= incAmt
     if schnauzActAmt >= btmCapAmt:
         print schnauzActAmt
         cmds.move(0, schnauzActAmt, 0)
     else:
         schnauzActAmt = btmCapAmt
Esempio n. 40
0
    def selectTracks(self, tracks):
        """ Given a list of tracks, first compiles a list of track nodes then
            has Maya select them. """

        nodes = list()
        for t in tracks:
            nodes.append(self.getTrackNode(t))

        # and pass that list to Maya to be selected
        if len(nodes) > 0:
            cmds.select(nodes)
Esempio n. 41
0
    def selectAllTracks(self):
        """ All tracks are selected, by accumulating a list of all track nodes
            in the trackway layers. """

        layers = cmds.ls( type='displayLayer')
        nodes  = list()
        for layer in layers:
            if layer.endswith(self.LAYER_SUFFIX):
               nodes.extend(cmds.editDisplayLayerMembers(
                   layer, query=True, noRecurse=True))
        cmds.select(nodes)
Esempio n. 42
0
 def handleSchnauzUpBtn(self):
     global schnauzActAmt
     global incAmt
     topCapAmt = 0.028
     cmds.select('schnauzClusterHandle')
     schnauzActAmt += incAmt
     if schnauzActAmt <= topCapAmt:
         print schnauzActAmt
         cmds.move(0, schnauzActAmt, 0)
     else:
         schnauzActAmt = topCapAmt
Esempio n. 43
0
 def handleUpBtn(self):
     global smileActAmt
     global incAmt
     topCapAmt = 0.016
     cmds.select('smileClusterHandle')
     smileActAmt += incAmt
     if smileActAmt <= topCapAmt:
         print smileActAmt
         cmds.move(0, smileActAmt, 0)
     else:
         smileActAmt = topCapAmt
Esempio n. 44
0
 def handleDownBtn(self):
     global smileActAmt
     global incAmt
     btmCapAmt = -0.032
     cmds.select('smileClusterHandle')
     smileActAmt -= incAmt
     if smileActAmt >= btmCapAmt:
         print smileActAmt
         cmds.move(0, smileActAmt, 0)
     else:
         smileActAmt = btmCapAmt
Esempio n. 45
0
 def handleEyebrowsDwnBtn(self):
     global eyebrowsActAmt
     global eyebrowsIncAmt
     btmCapAmt = -0.014
     cmds.select('eyebrowsClusterHandle')
     eyebrowsActAmt -= eyebrowsIncAmt
     if eyebrowsActAmt >= btmCapAmt:
         print eyebrowsActAmt
         cmds.move(0, eyebrowsActAmt, 0)
     else:
         eyebrowsActAmt = btmCapAmt
Esempio n. 46
0
 def handleEyebrowsUpBtn(self):
     global eyebrowsActAmt
     global eyebrowsIncAmt
     topCapAmt = 0.021
     cmds.select('eyebrowsClusterHandle')
     eyebrowsActAmt += eyebrowsIncAmt
     if eyebrowsActAmt <= topCapAmt:
         print eyebrowsActAmt
         cmds.move(0, eyebrowsActAmt, 0)
     else:
         eyebrowsActAmt = topCapAmt
Esempio n. 47
0
 def handleSchnauzDownBtn(self):
     global schnauzActAmt
     global incAmt
     btmCapAmt = 0.000
     cmds.select('schnauzClusterHandle')
     schnauzActAmt -= incAmt
     if schnauzActAmt >= btmCapAmt:
         print schnauzActAmt
         cmds.move(0, schnauzActAmt, 0)
     else:
         schnauzActAmt = btmCapAmt
Esempio n. 48
0
    def selectToken(self, uid, setFocus =True, closeup =True):
        """ Select the node corresponding to this UID, then focusses the camera
            upon that node. """

        node = self.getTokenNodeName(uid)

        if not node:
            return

        cmds.select(node)
        if setFocus:
            self.setCameraFocus(closeup)
Esempio n. 49
0
    def _handleExampleButton(self):
        """
        This callback creates a polygonal cylinder in the Maya scene.

        """
        r = 50
        a = 2.0*r
        y = (0, 1, 0)
        c = cmds.polyCylinder(
            r=r, h=5, sx=40, sy=1, sz=1, ax=y, rcp=0, cuv=2, ch=1, n='exampleCylinder')[0]
        cmds.select(c)
        response = nimble.createRemoteResponse(globals())
        response.put('name', c)
Esempio n. 50
0
        def MoveVertex(min, max):
            cmds.select(ado=True)
            selected = cmds.ls(selection=True, long=True)

            for object in selected:
                total = cmds.polyEvaluate(object, vertex=True)
                for i in range(total):

                    randNumX = random.uniform(min, max)
                    randNumY = random.uniform(min, max)
                    randNumZ = random.uniform(min, max)
                    vertex = object+'.vtx['+str(i)+']'
                    cmds.select(vertex)
                    cmds.move(randNumX, randNumY, randNumZ, relative=True)
Esempio n. 51
0
    def handleBallBtn(self):
        cmds.select('ball')
        cmds.currentTime(74)
        cmds.setKeyframe('ball')

        cmds.currentTime(112)
        cmds.move(-0.757, 6.434, 15.831)
        cmds.rotate(9.208, 17.386, -368.887)
        cmds.setKeyframe('ball')

        cmds.currentTime(144)
        cmds.move(-0.772, 0.637, 22.462)
        cmds.rotate(9.208, 17.386, -368.887)
        cmds.setKeyframe('ball')
Esempio n. 52
0
 def _checkType(self):
     highBound = float(self.HightBound.text())
     lowBound = float(self.LowBound.text())
     curvature = float(self.Curvature.text())
     factor =  float(self.Factor.text())
     cmds.select(created+'2')
     if self.BendRadioButton.isChecked():
         type= 'bend'
         cmds.nonLinear( type='bend', highBound=highBound, lowBound=lowBound, curvature=curvature)
     if self.SquashRadioButton.isChecked():
         type = 'squash'
         cmds.nonLinear( type='squash', highBound=highBound, lowBound=lowBound, factor=factor)
     print type
     return   type
Esempio n. 53
0
    def handleScriptBtn(self):
        cmds.select('arm_R')
        cmds.currentTime(1)
        cmds.setKeyframe('arm_R', at='rotateX')

        cmds.currentTime(20)
        cmds.rotate(-142.85, 0, 0)
        cmds.setKeyframe('arm_R', at='rotateX')

        cmds.currentTime(32)
        cmds.rotate(-142.85, 0, 0)
        cmds.setKeyframe('arm_R', at='rotateX')

        cmds.currentTime(48)
        cmds.rotate(0, 0, 0)
        cmds.setKeyframe('arm_R', at='rotateX')
Esempio n. 54
0
    def createRenderEnvironment(self):
        lightName = 'scenic_light1'
        if not cmds.objExists(lightName):
            lightName = cmds.directionalLight(name=lightName, intensity=0.5)
            cmds.move(0, 2500, 0, lightName)
            cmds.rotate('-45deg', '-45deg', 0, lightName)

        lightName = 'scenic_light2'
        if not cmds.objExists(lightName):
            lightName = cmds.directionalLight(name=lightName, intensity=0.5)
            cmds.move(0, 2500, 0, lightName)
            cmds.rotate('-45deg', '135deg', 0, lightName)

        floorName = 'floor'
        if not cmds.objExists(floorName):
            floorName = cmds.polyPlane(width=10000, height=10000, name=floorName)[0]
        shader, shaderEngine = self.createShader('Whiteout_Surface', 'surfaceShader')
        cmds.setAttr(shader + '.outColor', 1.0, 1.0, 1.0, type='double3')
        cmds.select([floorName])
        cmds.sets(forceElement=shaderEngine)
    def _handleKick(self):

        ctime = cmds.currentTime(query=True)
        cmds.select('leg_R')

        cmds.setAttr('leg_R.rx', 0)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 10)
        cmds.setAttr('leg_R.rx', 90)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 20)
        cmds.setAttr('leg_R.rx', -90)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 30)
        cmds.setAttr('leg_R.rx', 0)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 15)
Esempio n. 56
0
    def findPrevious(cls, start=False):
        prints = cls.getTargets(1)
        if not prints:
            return False

        selection = []
        for p in prints:
            prev = p
            while True:
                prevs = cls.getPrevious(target=prev)
                if not prevs:
                    break
                prev = prevs[0]

                # Breaks on the first find if the previous was selected
                if not start:
                    break

            if prev not in selection:
                selection.append(prev)

        cmds.select(selection)
Esempio n. 57
0
    def findNext(cls, end =False):
        prints = cls.getTargets(1)
        if not prints:
            return False

        selection = []
        for p in prints:
            next = p
            while True:
                nexts = cls.getNext(next)
                if not nexts:
                    break
                next = nexts[0]

                # Breaks on the first find if the next was selected
                if not end:
                    break

            if next not in selection:
                selection.append(next)

        cmds.select(selection)
    def _handleArm(self):

        ctime = cmds.currentTime(query=True)

        cmds.select('arm_L')

        cmds.setAttr('arm_L.rx', 0)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 10)
        cmds.setAttr('arm_L.rx', -90)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 15)
        cmds.setAttr('arm_L.rx', -180)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 25)
        cmds.setAttr('arm_L.rx', -180)
        cmds.setKeyframe()

        cmds.currentTime(ctime + 35)
        cmds.setAttr('arm_L.rx', 0)
        cmds.setKeyframe()
        def rotate_limbs(angle):

          cmds.select('arm_L')
          cmds.setAttr('arm_L.rx', angle)
          cmds.setKeyframe(at='rotateX')

          cmds.select('arm_R')
          cmds.setAttr('arm_R.rx', -angle)
          cmds.setKeyframe(at='rotateX')

          cmds.select('left_L')
          cmds.setAttr('left_L.rx', -angle)
          cmds.setKeyframe(at='rotateX')

          cmds.select('leg_R')
          cmds.setAttr('leg_R.rx', angle)
          cmds.setKeyframe(at='rotateX')