Friday, 7 November 2014


Control shapes!

Here the control shapes have been added to my rig. There are still many improvements to be made regarding the size and shape of the control shapes around the armour. Using a python script that i made learning in the practical labs, allowed me to create a CV curve around any joint with a single click. Here is the my python script, with help I was working together with classmate - Lee Henry. I find the introduction to python strangely steep.

--------------------------------------------------------------------------------------------------------------------------

import maya.cmds as cmds

joint_list = cmds.ls(selection=True, type="joint")
for joint_name in joint_list:
   
    # remove the letters "jnt" from the joint name and store the remainder of the name
    # e.g. jnt_head becomes _head
    joint_name_stub = joint_name.replace("Jnt", "")
   
    #print out the control shape name for this joint using the joint name stub
    #e.g. _head becomes ctrl_head
   
    control_shape_name = "ctrl"+joint_name_stub
    print control_shape_name
   
    #print out the name of the offset group using the joint name stub
    #e.g. _head becoms grp_head_offset
   
    group_name = "grp"+joint_name_stub+"_offset"
    print group_name

    cmds.circle(ch=1, o=1, r=2, nr=(0,1,0), name=control_shape_name)

    cmds.group( name=group_name )
    
    cmds.parent(group_name, joint_name)

    cmds.setAttr(group_name+".translateX", 0)
    cmds.setAttr(group_name+".translateY", 0)
    cmds.setAttr(group_name+".translateZ", 0)
    cmds.parent( group_name, world=True )

--------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment