
I wanted to really learn more about the different deformers in Maya and so I tasked myself to create a ribbon rig which took about 3 days to complete. I had prior knowledge from the more bespoke rigging tasks that I was able to do.
I used a NURBs planar surface as the base geometry for the deformation. I needed to add evenly spaced joints so I opted to use the nHair system to generate follicles that would be placed on the surface. And then I needed to rename each follicle with a transform group, control and joint parented to one another. And in order to make the process less repetitive I wrote a script:
from maya import cmds
# store the selected objects into a variable
selection=cmds.ls(selection=True)
# Loop through each selected item
for x in range(0, len(selection)):
# rename the curent item in thelist
selection[x] = cmds.rename(selection[x], ('ribbon_follicle_' + str(x+1)))
# create controller for the current follicle
ctrl = cmds.circle(c=(0,0,0), nr=(1,0,0), r=0.5, ch=0, name=('ribbon_ctrl_' + str(x+1)))[0]
# create joint for current follicle
jnt = cmds.joint(radius=0.15, name=('ribbon_joint_' + str(x+1)))
# group the controller
grp = cmds.group(ctrl, name=(ctrl + '_xform_grp'))
# set colour of the controller
cmds.setAttr((cmds.listRelatives(ctrl, type='shape')[0] + '.overrideEnabled'), 1)
cmds.setAttr((cmds.listRelatives(ctrl, type='shape')[0] + '.overrideColor'), 1)
# parent the controller under the current follicle
cmds.parent(grp, selection[x])
# position the controller at the follicle's position
cmds.setAttr((grp + '.translate'), 0,0,0)
Afterwards I created locator controls for the start, middle and end controls. I then added attributes that will drive the twist, sine deformations. For the twist deformer I had to use the plusminusaverage node to drive the twist and roll deformations. Using both connection editor and node editor to create connections to drive the process through.
I connected the locator controls using the wire deformer to drive and manipulate the curve. I had a double transform issues with the middle control and which was affected by the start and end controls that needed to be decreased to average out the influences.
I then was able to blend the different geometry deformers using blendshapes which behaved differently than I had anticipated. I had to check the inputs and change the hierarchy so that the wire deformer is driving the blendshapes which solved the problem. I added the final blendshape onto the original mesh which was able to behave accordingly.