Using Aim Constraints and Set Driven Keys

 

We can use an Ik chain to control the connecting arms of the scoop, by parenting the IK Handle to the scoop:

Next we need to get the piston to follow the elbow of the connecting arms. this can be done in two steps.

First, we need to aim the piston to the elbow geometry. Check the local rotation axis of the upper_arm_piston1

Notice that the local Y axis points away from where the piston needs to point.

This means we want -Y to point at the connecting arm elbow. Select elbow rod followed by the piston group and open Constrain->Aim options:

Set the Aim vector to x=0, y=-1, and z=0 and hit apply. The piston group should snap to the elbow bar


Now no matter how the scoop is rotated, the piston will point in the correct location.

To make the piston stretch to the elbow rod, we want to set it's position (translate y) as a function of the scoops rotation. An easy way to do this is to use Set Driven Keys.

Open Animate->Set Driven Key->Set...

With the Set Driven Key window open, we see that we must select an object and attribute to control the attibute of one or several other objects. The object doing the controlling is the Driver and the object or objects being controlled are the Driven. We want the scoop rotate X to drive the translate Y of the piston. Select the scoop and use Load->Selected as Driver. Click on "Rotate X' in the right side of the window.

Now select the piston and use Load->Selected as Driven. Click on "Translate Y" in the right side of the driven window.

Now rotate the scoop to the extremes of it's range and position the piston. To position the piston, change the moveTool settings to Move Axis to Object mode:

 

Once the positions are correct hit "Key" in the Set Driven Key window.

Repeat in the middle throught and at the other far extreme:

Rotate the scoop over it's range. If the piston is not positioned correctly, select the piston (the driven object) and open the Graph Editor. Adjust tangents or add another key to correct:


Limits on the scoop's rotation can be set in the Attribute Editor. Select the scoop, open the transform node and open the Limit Information section. Click the enable Min and Max boxes and enter the minimum and maximum values for the attribute.