Esempio n. 1
0
def gameOpt():

    # dialogue box
    softenEdgeDialogue = cmds.confirmDialog(t='Soften Edges',
                                            b=['Yes', 'No'],
                                            defaultButton='Yes',
                                            cancelButton='No',
                                            dismissString='No')

    # this softens the mesh's edges, should the user click 'Yes'
    if softenEdgeDialogue == 'Yes':
        for i in objs:
            cmds.select(i)
            cmds.polySoftEdge(a=180)

    # this runs optimization commands for game engine
    for i in objs:
        cmds.select(i)
        cmds.snapMode(gr=True)
        cmds.move(rpr=True)
        cmds.snapMode(gr=False)
        cmds.makeIdentity(apply=True, t=1, r=1, s=1, n=0, pn=1)
        cmds.DeleteHistory()
    # deselect
    cmds.select(clear=True)
Esempio n. 2
0
 def c(self):
     if Cache.currentContext == 'myMove':
         cmds.snapMode(curve=True)
     else:
         if self.getSelection() == 'None':
             self.primitiveMenu()
         elif len(self.getSelection()) == 2:
             if self.getType(0)[0] == 'camera':
                 self.constrainToParent('bake')
             else:
                 self.constrainToParent('noBake', 'Maintain')
         else:
             print 'this is where we can place the convert or create tools'
Esempio n. 3
0
	def c (self):
		if Cache.currentContext == 'myMove':
			cmds.snapMode( curve = True )
		else:
			if self.getSelection() == 'None':
				self.primitiveMenu()
			elif len(self.getSelection()) == 2:
				if self.getType(0)[0] == 'camera':
					self.constrainToParent('bake')
				else:
					self.constrainToParent('noBake', 'Maintain')
			else:
				print 'this is where we can place the convert or create tools'
def TanLock(arg=None):
    """
    //Lock tangents

    string $panType = `getPanel -withFocus`;
    {
    if ($panType == "graphEditor1") {
        undoInfo -stateWithoutFlush off;
        keyTangent -weightLock off;
        undoInfo -stateWithoutFlush on;
        }
    else dR_DoCmd("pointSnapPress");
    }


    //Unlock tangents

    string $panType = `getPanel -withFocus`;
    {
    if ($panType == "graphEditor1") {
        undoInfo -stateWithoutFlush off;
        keyTangent -weightLock on;
        undoInfo -stateWithoutFlush on;
        }
    else dR_DoCmd("pointSnapRelease");
    }
    """

    panType = cmds.getPanel(wf=True)
    if arg == "Press":
        if panType == "graphEditor1":
            cmds.undoInfo(swf=False)
            mel.eval('MoveTool;')
            cmds.keyTangent(e=True, wl=False)
            cmds.undoInfo(swf=True)
        else:
            cmds.snapMode(point=True)
    elif arg == "Release":
        if panType == "graphEditor1":
            cmds.undoInfo(swf=False)
            mel.eval('global string $gSelect; setToolTo $gSelect')
            cmds.keyTangent(e=True, wl=True)
            cmds.undoInfo(swf=True)
        else:
            cmds.snapMode(point=False)
def TanLock(arg=None):
    """
    //Lock tangents

    string $panType = `getPanel -withFocus`;
    {
    if ($panType == "graphEditor1") {
        undoInfo -stateWithoutFlush off;
        keyTangent -weightLock off;
        undoInfo -stateWithoutFlush on;
        }
    else dR_DoCmd("pointSnapPress");
    }


    //Unlock tangents

    string $panType = `getPanel -withFocus`;
    {
    if ($panType == "graphEditor1") {
        undoInfo -stateWithoutFlush off;
        keyTangent -weightLock on;
        undoInfo -stateWithoutFlush on;
        }
    else dR_DoCmd("pointSnapRelease");
    }
    """

    panType = cmds.getPanel(wf=True)
    if arg == "Press":
        if panType == "graphEditor1":
            cmds.undoInfo(swf=False)
            mel.eval('MoveTool;')
            cmds.keyTangent(e=True, wl=False)
            cmds.undoInfo(swf=True)
        else:
            cmds.snapMode(point=True)
    elif arg == "Release":
        if panType == "graphEditor1":
            cmds.undoInfo(swf=False)
            mel.eval('global string $gSelect; setToolTo $gSelect')
            cmds.keyTangent(e=True, wl=True)
            cmds.undoInfo(swf=True)
        else:
            cmds.snapMode(point=False)
Esempio n. 6
0
 def c_release(self):
     cmds.snapMode(curve=False)
Esempio n. 7
0
	def C_release (self):
		cmds.snapMode( curve = False ) # it gets stuck for some reason and must be turned off
Esempio n. 8
0
 def x_release(self):
     cmds.snapMode(grid=False)
Esempio n. 9
0
 def v_release(self):
     cmds.snapMode(point=False)
Esempio n. 10
0
 def x(self):
     cmds.snapMode(grid=True)
Esempio n. 11
0
 def C_release(self):
     cmds.snapMode(curve=False
                   )  # it gets stuck for some reason and must be turned off
Esempio n. 12
0
 def v(self):
     cmds.snapMode(point=True)
Esempio n. 13
0
	def c_release (self):
		cmds.snapMode( curve = False )
Esempio n. 14
0
	def v (self):
		cmds.snapMode( point = True )
Esempio n. 15
0
	def x_release (self):
		cmds.snapMode( grid = False )
Esempio n. 16
0
	def x (self):
		cmds.snapMode( grid = True )
Esempio n. 17
0
	def v_release (self):
		cmds.snapMode( point = False )