This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmds.polyColorPerVertex ( r =0.0 , g =1.0 , b =0.0 , a =1, cdo =True ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myCode = ''' | |
from maya import cmds | |
def test(): | |
print 'ok' | |
sel = cmds.ls(sl=True) | |
obj_attr = '%s.color' % sel[0] | |
colorNum = cmds.getAttr( obj_attr ) | |
if cmds.getAttr(obj_attr) == 0 : | |
cmds.polyColorPerVertex(r=0.0,g=1.0,b=0.0,a=1,cdo=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window; | |
columnLayout; | |
string $selObj[] = `ls -sl` ; | |
textFieldButtonGrp -text $selObj[0] -buttonLabel "Button" -buttonCommand "objectName" selectedObject; | |
proc objectName(){ | |
string $selObj[] = `ls -sl` ; | |
textFieldButtonGrp -e -text $selObj[0] -buttonLabel "Button" -buttonCommand "objectName" selectedObject; | |
} | |
showWindow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loopOut(type = "cycle", numKeyframes = 0) | |
stop = marker.key(marker.numKeys).time; | |
loopDur = key(numKeys).time; | |
if (time > stop){ | |
stop%loopDur; | |
}else{ | |
loopOut(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace -mv "insert_namespace_here" ":" -force; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc updateUi() | |
{ | |
string $sld[] = (`ls -sl`); | |
print $sld[0]; | |
textField -edit -tx $sld tfd ; | |
} | |
scriptJob -ct "SomethingSelected" "updateUi()"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Following is the exercise, function provided: | |
from functools import partial | |
def func(u,v,w,x): | |
return u + v + w + x | |
#Enter your code here to create and print with your partial function | |
dbl = partial(func, 4 , 4 , 4) | |
print (dbl(4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
def colorChange() : | |
if cmds.getAttr('pSphere1.color')==0 : # attribut a Blue | |
cmds.polyColorPerVertex(r=.159,g=.3811,b=.86,a=1,cdo=True) | |
elif cmds.getAttr('pSphere1.color')==1 : # attribut a Red | |
cmds.polyColorPerVertex(r=.86,g=.159,b=.3811,a=1,cdo=True) | |
elif cmds.getAttr('pSphere1.color')==2 : # attribut a Green | |
cmds.polyColorPerVertex(r=.3811,g=.86,b=.159,a=1,cdo=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Toggle Viewport X-Ray: | |
$currentPanel = `getPanel -withFocus`; | |
string $panelType = `getPanel -to $currentPanel`; | |
if ($panelType == "modelPanel") | |
{ modelEditor -e -xray ( !`modelEditor -q -xray $currentPanel` ) $currentPanel; | |
} |
OlderNewer