How to Rig an Automatic Piston in Blender

Creating an automatic piston system in Blender relies on bone constraints that force two opposing mechanical components—the piston rod and the cylinder—to continuously aim at each other. By utilizing Blender's Damped Track constraints within an armature, you can animate a mechanical assembly where the piston automatically extends, retracts, and pivots realistically as its anchor points move, eliminating the need for manual alignment keyframing.

Step 1: Set Up the Armature

  1. Switch to Object Mode and add a single bone via Add > Armature > Single Bone.
  2. Name this bone Base_Bone and position its head (the thicker base) at the pivot point of your cylinder housing. Point the tail toward the piston rod.
  3. In Edit Mode, duplicate the bone or add a new one, naming it Piston_Bone. Position its head at the pivot point where the piston rod connects to the moving mechanical part, and point its tail toward the Base_Bone.
  4. Create two additional control bones at each hinge location (Base_Controller and Piston_Controller) if you plan to link the piston assembly to a larger mechanical rig. Unparent the main bones from each other so they can rotate freely.

Step 2: Apply the Damped Track Constraints

  1. Select the Armature and switch to Pose Mode.
  2. Select the Base_Bone, navigate to the Bone Constraints tab on the Properties panel, and click Add Bone Constraint > Damped Track.
  3. Set the Target to your armature and select Piston_Bone (or Piston_Controller) as the target Bone.
  4. Set the To axis to the axis pointing along the length of your bone (typically +Y or -Y in Blender).
  5. Select the Piston_Bone, add another Damped Track constraint, set the Target to the armature, and select Base_Bone (or Base_Controller) as the target bone, ensuring the tracking axis matches the bone's primary length axis.

Step 3: Bind the 3D Meshes to the Bones

  1. Switch back to Object Mode.
  2. Select your 3D cylinder mesh, hold Shift, and select the Armature.
  3. Switch to Pose Mode, select only the Base_Bone, press Ctrl + P, and select Bone.
  4. Repeat this process for the piston rod mesh by selecting the mesh, then the Armature, entering Pose Mode, selecting the Piston_Bone, pressing Ctrl + P, and choosing Bone.

Step 4: Test and Finalize

  1. In Pose Mode, grab and move either the Piston_Bone or your designated controller bone using the G key.
  2. Both bones will dynamically rotate and point at each other, creating an automatic sliding piston effect.
  3. If you experience axis flipping, ensure the bone roll is aligned properly in Edit Mode (Ctrl + N > Recalculate Roll) and verify that the Damped Track constraint axis matches the bone direction.