This tutorial requires:
Pixels|3D Studio v3.6.1 or higher
Constraints Pro 2.0
The tutorial scene file

Description
In this tutorial, we will use linking, an IK chain, a few simple expressions, and Constraints Pro to create the effect of a bar linked to a moving wheel by a peg.

Open the Scene File
There are 4 objects - Wheel, Peg, Bar, and a Control Null.



In the schematic view, link the Peg to the Wheel -



Then, link the Control_Null to the Peg



Create the IK Chain
Using the IK tool in the Front View, click the center of the peg, then click once more just above the top of the bar. Press the ESC key to end the IK chain. Accept the default name "IKChain"

.

Link the Bar to the IK Chain
Select 'Bar', then shift-select the IKChain_root. Choose Control > Link.



When the wheel rotates, we want it to pull on the chain & give a sine piston effect. For this we'll constrain the position of the IK_root to the control null (which will rotate around with the Peg).

Select the IKChain_root



Use Constraints Pro
From the Extras Menu, or Favorites bar, choose Constraints Pro 2.0
When the interface comes up, the IKChain_root will show in the popup menu.
Set the Position constraint modes to 'Object' > 'Control Null' for X,Y, and Z axes.
Click 'Apply', then 'Done'.



Spin the Wheel
To spin the wheel, we'll use a simple expression that takes the frame number, multiplies it by 10, and assigns it to the wheel's z rotation.

Select the wheel object, open the Expression Editor, and enter the following script

.

Counter Spin
Let's give the peg a counter spin, so when the wheel rotates around, the linked peg will appear to hold it's orientation.Select the Peg, and open the Expression Editor. Enter the following line.



This takes the z rotation of the Wheel
, inverts it sign, and assigns it to the z rotation of the Peg.

Move the IK joint into place
Select IK_jnt1, and in the front view, move it to the right side of the wheel. Notice how the IK chain handles the rotation of the bar for you. Position it a few units beyond the reach of the bar. This will give it just the right amount of 'pull' when the wheel spins around.

See the results
Do a pencil test from frame 0 to 35. Since the wheel is moving in increments of 10 frames, the animation will loop at 36 frames