Skip to content

Instantly share code, notes, and snippets.

View AndrewtConroy's full-sized avatar

Andrew AndrewtConroy

View GitHub Profile
@AndrewtConroy
AndrewtConroy / gist:3fddcd82d47e7543d33d
Created March 22, 2016 04:17
stretchy IK Handle - Rough
def buildIK() :
obj = 'Leg'
side = 'LF'
list = ['jntLeg01LF','jntLeg02LF','jntLeg03LF']
srtJoint = list[0]
midJoint = list[1]
endJoint = list[2]
parent = ''
import maya.cmds as cmds
import maya.mel as mel
'''
list = ['Leg_MoveLF','KneeJposLF','AnkleJposLF']
nameSpace = ''
# 'jntLeg01LF'
obj = 'jntLeg'
side = 'LF'
chain = True
@AndrewtConroy
AndrewtConroy / 0_reuse_code.js
Created October 20, 2015 19:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@AndrewtConroy
AndrewtConroy / UV_transfer.py
Last active October 20, 2015 19:22
UV transfer
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.
def selectBind():
pfx ='jnt'
newListIK = []
fullList = cmds.ls(type='joint')
for item in fullList:
if item.startswith(pfx ):
newListIK.append(item)
cmds.select(newListIK)
def selectBind(self):
pfx ='jnt'
newListIK = []
fullList = cmds.ls(type='joint')
for item in fullList:
if item.startswith(pfx ):
newListIK.append(item)
cmds.select(newListIK)
cmds.rename('LidDnLFSpline1','jntLidDnLFSpline1')
cmds.rename('LidDnLFSpline2','jntLidDnLFSpline2')
cmds.rename('LidDnLFSpline3','jntLidDnLFSpline3')
cmds.rename('LidDnLFSpline4','jntLidDnLFSpline4')
cmds.rename('LidDnLFSpline5','jntLidDnLFSpline5')
import maya.cmds as cmds
cmds.select(all=1,hi=1)
cmds.lockNode(lock=0)
allJoints = maya.cmds.ls(type='joint')
for joint in allJoints:
maya.cmds.setAttr(joint+'.radius',lock=0,keyable=1,channelBox=1)
maya.cmds.setAttr(joint+'.radius',1)
global proc TSM2_FKIKSwitchNoKeyframe()
{
int $cycleCheckState;
$cycleCheckState = `cycleCheck -q -e`;
if ($cycleCheckState == 1)
cycleCheck -e off;
int $i;