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 | |
if cmds.unknownPlugin(q=True,l=True): | |
for o in cmds.unknownPlugin(q=True,l=True): | |
cmds.unknownPlugin(o,r=True) | |
print o |
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
for toolBar in cmds.lsUI( type=["toolBar"] ): | |
if "Shelf" == cmds.toolBar(toolBar,l=True,q=True): | |
print toolBar | |
cmds.toolBar(toolBar,e=True,h=110) | |
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
sel = cmds.ls(sl=True,type="joint") | |
for s in sel: | |
cmds.setAttr(s+".translate",0,0,0,type="double3") | |
cmds.setAttr(s+".rotate",0,0,0,type="double3") | |
cmds.setAttr(s+".jointOrient",0,0,0,type="double3") |
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
sel = cmds.ls(sl=True,type="joint") | |
for s in sel: | |
cmds.setAttr(s+".segmentScaleCompensate",1) |
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
sel = cmds.ls(sl=True) | |
attr = cmds.listAttr(sel[0],channelBox=True) | |
attrVal = [] | |
for a in attr: | |
attrVal.append(cmds.getAttr(sel[0]+"."+a)) | |
for x in xrange(len(attr)): | |
cmds.setAttr(sel[1]+"."+attr[x],attrVal[x]) |
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 | |
import re | |
sel = cmds.ls(sl=True)[0] | |
blendShapesNode = cmds.ls(type="blendShape")[0] | |
blendShapesList = cmds.aliasAttr(blendShapesNode,q=True) | |
for bsl in blendShapesList: | |
if not re.search("weight",bsl): | |
trgList = cmds.listRelatives(bsl,allDescendents=True) | |
trgList.append(bsl) |
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
def togglePreserveChildPosition(): | |
if cmds.manipMoveContext("Move",q=True,preserveChildPosition=True): | |
cmds.manipMoveContext("Move",e=True,preserveChildPosition=False) | |
cmds.manipRotateContext("Rotate",e=True,preserveChildPosition=False) | |
cmds.manipScaleContext("Scale",e=True,preserveChildPosition=False) | |
else: | |
cmds.manipMoveContext("Move",e=True,preserveChildPosition=True) | |
cmds.manipRotateContext("Rotate",e=True,preserveChildPosition=True) | |
cmds.manipScaleContext("Scale",e=True,preserveChildPosition=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
from PySide import QtGui | |
def get_clipboard(): | |
cb = QtGui.QClipboard() | |
return cb.text() | |
def put_clipboard(text_u): | |
cb = QtGui.QClipboard() | |
cb.setText(text_u) |
NewerOlder