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 maya.mel as mel | |
''' | |
What is this: | |
This is a simple script that will copy UV's from one mech to another. The meshes should be simular for best results. | |
It will copy the UV's to a rigged mesh or a non rigged mesh. | |
Instructions: | |
In order to run this script correctly, just select the mesh with the good UV's, then select the mesh with bad UV's. |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 maya.mel as mel | |
''' | |
list = ['Leg_MoveLF','KneeJposLF','AnkleJposLF'] | |
nameSpace = '' | |
# 'jntLeg01LF' | |
obj = 'jntLeg' | |
side = 'LF' | |
chain = 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
def buildIK() : | |
obj = 'Leg' | |
side = 'LF' | |
list = ['jntLeg01LF','jntLeg02LF','jntLeg03LF'] | |
srtJoint = list[0] | |
midJoint = list[1] | |
endJoint = list[2] | |
parent = '' |
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 | |
pfx ='jnt' | |
jointList = [] | |
fullList = cmds.ls(type='joint') | |
for item in fullList: | |
if item.startswith(pfx ): | |
jointList.append(item) |
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 maya.mel as mel | |
selected = cmds.ls(sl=1) | |
skinnedMesh = selected[0] | |
skinCluster = mel.eval('findRelatedSkinCluster ' + skinnedMesh) | |
skinnedJoints = cmds.skinCluster(skinCluster,query=True,inf=True) | |
cmds.select(skinnedJoints) |
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 | |
selected = cmds.ls(sl=1) | |
for item in selected: | |
override = cmds.getAttr(item + '.overrideEnabled') | |
display = cmds.getAttr(item + '.overrideDisplayType') | |
if override == 0 : | |
cmds.setAttr(item + '.overrideEnabled', 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
# select two objects. First, the one with a skinCluster you like. Second, an object you want to have a matching skin. | |
# Once selected, hit the button. This will make matching skingCluster influences. | |
#Once this is done, select the objects again and use maya's copy skinweights tool. | |
import maya.cmds as cmds | |
import maya.mel as mel | |
selected = cmds.ls(sl=1) | |
skinnedMesh = selected[0] | |
newMesh = selected[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
from maya import OpenMaya, OpenMayaUI, OpenMayaAnim, cmds | |
from PySide import QtCore, QtGui | |
import shiboken, sys, os | |
import urllib2 | |
import json | |
import time | |
pointer = long(OpenMayaUI.MQtUtil.mainWindow()) | |
maya_window = shiboken.wrapInstance(pointer, QtGui.QMainWindow) | |
class LockDialog (QtGui.QDialog): | |
def __init__ (self, parent=maya_window): |
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 download(self): | |
gMainProgressBar = mel.eval('$tmp = $gMainProgressBar') | |
try: | |
hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11', | |
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', | |
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', | |
'Accept-Encoding': 'none', | |
'Accept-Language': 'en-US,en;q=0.8', | |
'Connection': 'keep-alive'} |