Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to put the joints into sets by the naming convention but when I'm return the list, I'm getting nothing while if i print the list it will give me the joints. so the function is working but it's not returning. so please can i get some help with that and in the picture you can find the whole scene with the result.
Thanks
that's my script:
import maya.cmds as cmds
def joints():
token = 'joint'
cornerToken = 'broadCorner'
centerJoint = 'c_joint_broad_01'
leftCornerJoint = 'l_joint_broadCorner_01'
rightCornerJoint = 'r_joint_broadCorner_01'
jointList = ['c_joint_01', 'l_joint_01', 'l_joint_02', 'l_joint_03', 'l_joint_04', 'l_joint_05', 'r_joint_01', 'r_joint_02', 'r_joint_03', 'r_joint_04', 'r_joint_05']
lookUp = {'left': {}, 'right': {}, 'center': {}}
for joints in jointList:
if joints.startswith('c') and token in joints:
lookUp['center'][joints] = [centerJoint]
if joints.startswith('l') and token in joints:
lookUp['left'][joints] = [centerJoint, leftCornerJoint]
if joints.startswith('r') and token in joints:
lookUp['right'][joints] = [centerJoint, rightCornerJoint]
return lookUp
joints()
Solved! Go to Solution.