Maya Rigging – Gears and Chain with IK Spline Setup

Tutorial on Rigging Gears and  Chain using a IK Spline Setup..

This is the process I used for my Steampunk Car that I’m currently in the process of creating (will post images up soon)

I used the tutorial from  3D World Issue 154 ~ Create a robot and rig tank tracks   as a reference and tweaked the process to use bones and IK Spline Setup.

If there are parts that need more screenshots or clarification let me know.

Maya Rigging – Gears and Chain with IK Spline Setup

34xkv

  1. Create part of the chain geometry – duplicate it and then join together to create a chain
    2013-08-19 15_37_22-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  2. Select all geometry of each section and group them all
  3. In top view add bone for every connection
    2013-08-19 15_47_28-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
    Capture
  4. Select Bones and the group node
  5. Skin > Bind to Skin > Rigid Bind  — if move you move one of the bones it should move your chain geometry.
    (Edited: For Maya 2015 – Select the Bones and group node and open script editor (windows > General Editor > Script Editor type RigidBindSkin. press Ctrl Enter)
  6. Create curve around gears for chain to follow
    wpid-Capture2.JPG
  7. Skeleton > IK Spline handle > options – (use same settings as below)
    Capture4
  8.  Select start joint than the end joint and the curve
  9. The chain should snap around your curve. If your chain doesn’t complete your curve undo the IK Spline and bones and create more geometry and bones. The chain should snap around your curve. If your chain doesn’t complete your curve undo the IK Spline and bones and create more geometry and bones.
    2013-08-19 16_03_26-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  10.  Delete the IK Handle in the Outliner
    Capture6
  11. This will disconnect the bones from the IK handle  but the geometry will still be in place.
  12. Duplicate the ik curve and name it motion path
  13. Skeleton > ik spline handle > options (use options below)
    Capture3
  14. Select start joint then the end joint and the curve
  15. It should snap into place again but this time in Outliner you will have a  transform group node if you select the node and move it, the chain and bones will follow
    2013-08-19 16_11_40-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  16. Using the transfer node we are going to connect it to the motion Path Curve
  17. Select the transform nod and curve motion path go to  Animate > Motion Paths > Attached to Motion Paths Option — I used the options below.
    Capture8
  18. scrub the timeline and it will move the chain around
  19. Create two locators name them  BigGear and Small Gear
  20. Select one of the gears and select one of the locators go to
  21. constrain > point constrain  options reset
  22. The locator should snap into the middle of the gear
  23. Repeat for the other Gear
  24. Both locators should be in the middle of the gears
    2013-08-19 16_23_30-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  25. Go into outliner and delete the Constraint
    2013-08-19 16_19_51-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  26. Select both locators and freeze transformations
  27. Select the locator and corresponding gear
  28. Constrain > Orient – ( you should be able to rotate the gear using the locator)
  29. Repeat for other Gear
  30. Create a Nurb Circle — Name is Gear_ctrl
  31. Select Gear and select circle using the point constraint process as before
  32. The circle should snap into place centre .  Delete the point constraint
  33. Move, scale and rotate the circle away from the gear slightly so it’s in front and can be selected easily
    2013-08-19 16_36_38-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  34. Freeze transformations on the circle
  35. In the motion path attribute properties break U Value connection
    2013-08-19 16_49_30-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  36. Select your IK Curve ( the curve that you used for the IK spline
  37. Isolate it so that you have just the curve visible
  38. Select all the vertices and go to  Create Deformers > Cluster
  39. Do the same for the Motion Path curve
  40. Parent Cluster 1 (IK Curve Cluster ) under Cluster 2 (motion Path Cluster)
  41. Select Motion Path and go to Edit Curve >  Reverse Curve Direction  ( make sure in Surfaces Menu)
  42. Open Hypershade ( Windows > Render Editors > Hypershade )
  43. Select the Motion Path curve in the Outliner
  44. Click the Input and Output connections button in the Hypershade 2013-07-14 15_20_13-Hypershade
  45. All the connections of the curve should appear Select the MotionPathShape Node and move it away from the graph 
    2013-08-19 17_42_42-Hypershade2013-08-19 17_44_22-Hypershade
  46. Create Curve Info node ( located under Utilities ) move it near Curve Shape Node
  47. Select  Curveshape node middle mouse button drag onto curve info node and select other to bring up the connection Editor . Select WordSpace for Outputs and inputCurve for Inputs
    2013-08-19 17_50_54-Connection Editor2013-08-19 17_51_01-Hypershade
  48. Select the curveinfo node and open the attribute editor .. The arc Length is the length your curve. Make note of the digits
    2013-08-19 19_20_17-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  49. We are going to create Expression ( This expression is based on 3D world tutorial tweaked code so that it works with this setup ) .,. Change the Length of curve to length of your curve..
    (click image to enlarge)

    2013-08-19 19_12_26-Expression Editor2 
    int $GearDirection;
    $GearSpeed = 200;
    float $GearRoateZ = Gear_ctrl.rotateZ;
    float $CurveLength = 178.359;
    if ($GearRoateZ < 0)
    {
    $GearDirection = -360;
    reverseCurve1.nodeState = 0;
    }
    else
    {
    $GearDirection = 360;
    reverseCurve1.nodeState = 1;
    }
    float $GearPos = ($GearRoateZ /(2 * 3.14 * $CurveLength)) * $GearDirection;motionPath1.uValue = ($GearPos % $GearSpeed)/$GearSpeed;
  50. Select the Small Gear Locator and the Big Wheel Locator go to Constrain >  Orient
  51. Select the Gear_ctrl  curve and Select Smaller Locator go to Constrain > Orient
  52. If rotate Gear_ctrl  curve the gears and chain should rotate
  53. If you notice that the gears are flipping or slipping
    How I fixed this was in motionPath attribute do below
    2013-08-19 20_15_06-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  54. Rotate the curve a bit so the U value changes.. and unclick follow.
  55. Now if you rotate the circle it should work fine
  56. Create Locator named Gears_Moveloc
  57. Organize the scene like follows
    2013-08-19 20_42_46-Autodesk Maya 2014 x64 - Student Version_ C__Users_Tigerzone_!VISUALEFFECTS_Stea
  58. Select both gear geometry and Ctrl + G  to group them.. name group Gears
  59. Select the Gears_Moveloc locater and the Gear Group node and do Constrain  > Parent
  60. Now you can move the whole rig with Gears_Moveloc

7 thoughts on “Maya Rigging – Gears and Chain with IK Spline Setup

  1. Hi,
    first of all, great tutorial, helped me a lot, but I’m stuck at step 39. I have no idea what that “Cluster 2 (motion Path Cluster)” is. Do you mean the transform node which comes from the ik spline tool?
    If you could clarify that or upload the scene file I would very much appreciate it.

    • just figured it out 🙂
      the solution is to create a cluster from the motion path curve as well before step 39 just like you did it for the IK Curve. then you have the two clusters you need in step 40.

      • Hi Chris sorry for the late reply, didn’t realize wordpress was not emailing me. I’m glad that the tutorial help you and that you worked it out, thank you for the feedback I’ll update the tutorial. 🙂

Leave a comment