Maya Sticky Lips Rigging Tutorial Part 2


https://i.ytimg.com/vi/_PWLeF-zK4U/hqdefault.jpg



This video playlist covers the rigging setup of sticky lips (aka zipper lips) using a series of blendshapes and setRange nodes.

This video covers the creation of the curves, the blendshapes, and the setRange nodes.

***These tutorial videos are for more advanced rigging. You should already have a very firm grasp of Maya, character rigging, as well as Python scripting before attempting this setup.

source


12 responses to “Maya Sticky Lips Rigging Tutorial Part 2”

  1. Hey! I'm having an issue with the setRange node creation script. I'm sure it's obvious but I'm getting an error on the last line:
    // Error: invalid syntax
    # File "<maya console>", line 81
    # name_counter = name_counter + 1
    # ^
    # SyntaxError: invalid syntax //

    It looks like the indentation is correct, and the error is aligned to right after the "1", what is wrong here?
    Thanks!

  2. I have an erro on line 13:
    lip_sr = pm.shadingNode( 'setRange', asUtility=True, n='lf_' + lip_name_list[name_counter] + str(counter+1) + '_setRange')
    # Error: NameError: file <maya console> line 13: name 'pm' is not defined #

    do you know what a can do?

  3. i used the python, am getting error in 8th line. am not good in python..so not able to get the point..

    # Error: line 1: unexpected indent
    # File "<maya console>", line 8
    # for each in lip_val_list
    # ^
    # IndentationError: unexpected indent #

    can you help to sort it out.. orelse please provide a tutorial to link the setarrange node and blendshape in manual without script.

  4. I'm a bit late to the party here, but when I run the provided python (I changed the names of lr_main_attr and rt_main_attr to match my attribute paths, as well as changed the lip_val_list numbers to match my CV counts), all I get is "invalid syntax". Any ideas as to what's going on?

  5. Hello sir,
    I understood the concept
    But I have written same script
    Sticky lips is working
    But I am not getting same output as yours
    Could please check my file
    I will share
    Please give me your mail id

  6. Hey man, awesome setup! I'd really like to implement this on my own but the script is giving me error at line 69. I also tried with your own naming convention but same thing. I quadra-checked it from the video. Code with fixed identation is down below(copy/paste code from youtube comment is not ideal i guess) . Can you check on what's going on or put the code to pastebin so i can try that again? I put the error to the bottom. I tried to re-define it, left is working but right isn't.

    https://pastebin.com/N2wMUZU2

  7. Here is the Python code used to create the setRange node setup for the stickyLips:
    lf_main_attr = "head_icon.Lf_Sticky_Lips"
    rt_main_attr = "head_icon.Rt_Sticky_Lips"
    lip_val_list = [34, 30]
    lip_name_list = ['upperLip', 'lowerLip']

    name_counter = 0
    for each in lip_val_list:
    half_val = (each / 2) + 1
    total_val = each + 1
    div_val = 10.0 / half_val
    counter = 0
    while(counter<half_val):
    lip_sr = pm.shadingNode( 'setRange', asUtility=True, n='lf_' + lip_name_list[name_counter] + str(counter+1) + '_setRange')
    pm.setAttr(lip_sr + '.oldMaxX', (div_val * (counter+1)))
    pm.setAttr(lip_sr + '.oldMinX', (div_val * counter))
    pm.setAttr(lip_sr + '.maxX', 0)
    pm.setAttr(lip_sr + '.minX', 1)
    if counter == (half_val – 1):
    pm.setAttr(lip_sr + '.minX', 0.5)
    pm.connectAttr(lf_main_attr, lip_sr + '.valueX', f=True)

    lip_flip_sr = pm.shadingNode( 'setRange', asUtility=True, n='lf_' + lip_name_list[name_counter] + '_flip' + str(counter+1) + '_setRange')
    pm.setAttr(lip_flip_sr + '.oldMaxX', 1)
    if counter == (half_val – 1):
    pm.setAttr(lip_flip_sr + '.oldMaxX', 0.5)
    pm.setAttr(lip_flip_sr + '.oldMinX', 0)
    pm.setAttr(lip_flip_sr + '.maxX', 0)
    pm.setAttr(lip_flip_sr + '.minX', 1)
    if counter == (half_val – 1):
    pm.setAttr(lip_flip_sr + '.minX', 0.5)
    pm.connectAttr(lip_sr + '.outValueX', lip_flip_sr + '.valueX', f=True)

    if counter == (half_val – 1):
    mid_pma = pm.shadingNode( 'plusMinusAverage', asUtility=True, n='ct_' + lip_name_list[name_counter] + str(counter+1) + '_plusMinusAverage')
    pm.connectAttr(lip_sr + '.outValueX', mid_pma + '.input2D[0].input2Dx', f=True)
    pm.connectAttr(lip_flip_sr + '.outValueX', mid_pma + '.input2D[0].input2Dy', f=True)
    else:
    pm.connectAttr(lip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[0].targetWeights[' + str(counter) + ']', f=True)
    pm.connectAttr(lip_flip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[1].targetWeights[' + str(counter) + ']', f=True)

    counter = counter + 1

    #div_val = 10.0 / 39
    counter = half_val – 1
    rev_counter = half_val
    while(counter<total_val):
    lip_sr = pm.shadingNode( 'setRange', asUtility=True, n='rt_' + lip_name_list[name_counter] + str(counter+1) + '_setRange')
    pm.setAttr(lip_sr + '.oldMaxX', (div_val * rev_counter))
    pm.setAttr(lip_sr + '.oldMinX', (div_val * (rev_counter-1)))
    pm.setAttr(lip_sr + '.maxX', 0)
    pm.setAttr(lip_sr + '.minX', 1)
    if counter == (half_val – 1):
    pm.setAttr(lip_sr + '.minX', 0.5)
    pm.connectAttr(rt_main_attr, lip_sr + '.valueX', f=True)

    lip_flip_sr = pm.shadingNode( 'setRange', asUtility=True, n='rt_' + lip_name_list[name_counter] + '_flip' + str(counter+1) + '_setRange')
    pm.setAttr(lip_flip_sr + '.oldMaxX', 1)
    if counter == (half_val – 1):
    pm.setAttr(lip_flip_sr + '.oldMaxX', 0.5)
    pm.setAttr(lip_flip_sr + '.oldMinX', 0)
    pm.setAttr(lip_flip_sr + '.maxX', 0)
    pm.setAttr(lip_flip_sr + '.minX', 1)
    if counter == (half_val – 1):
    pm.setAttr(lip_flip_sr + '.minX', 0.5)
    pm.connectAttr(lip_sr + '.outValueX', lip_flip_sr + '.valueX', f=True)

    if counter == (half_val – 1):
    pm.connectAttr(lip_sr + '.outValueX', mid_pma + '.input2D[1].input2Dx', f=True)
    pm.connectAttr(lip_flip_sr + '.outValueX', mid_pma + '.input2D[1].input2Dy', f=True)
    pm.connectAttr(mid_pma + '.output2Dx', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[0].targetWeights[' + str(counter) + ']', f=True)
    pm.connectAttr(mid_pma + '.output2Dy', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[1].targetWeights[' + str(counter) + ']', f=True)
    else:
    pm.connectAttr(lip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[0].targetWeights[' + str(counter) + ']', f=True)
    pm.connectAttr(lip_flip_sr + '.outValueX', lip_name_list[name_counter] + '_wire_bShape.inputTarget[0].inputTargetGroup[1].targetWeights[' + str(counter) + ']', f=True)

    counter = counter + 1
    rev_counter = rev_counter – 1
    name_counter = name_counter + 1

Leave a Reply