Created
March 22, 2016 02:54
-
-
Save AndrewtConroy/dc1b5ec42e41806611b6 to your computer and use it in GitHub Desktop.
joint2List
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 | |
''' | |
def joints2List(list, nameSpace, obj, side, chain = True) : | |
cmds.select(clear = 1) | |
count = 01 | |
for item in list : | |
if chain == False : | |
cmds.select(clear = 1) | |
if count < 10 : | |
zero = '0' | |
else: | |
zero = '' | |
joint = cmds.joint(n = nameSpace + obj + zero + str(count) + side) | |
utils.snap(item, joint) | |
count = count + 1 | |
cmds.select(nameSpace + obj + '01' + side) | |
mel.eval('joint -e -oj xyz -secondaryAxisOrient yup -ch -zso;') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment