This expression sets the position and rotation of one object depending on two to four other objects, or simply said: it positions the target between the "controllers". Move any controller, and the target will move as well. Each controller contributes with a certain weight and allows a factor and an offset for special applications. Each axis can be set separately.
First, the number of controllers has to be set. Two controllers are minimum, four maximum. The controllers must be identified by either a link, or by a local name search (see the Kinematic Tools page for details). The Active flag will determine whether the tag expression is applied, and finally the Source/Target mode decides whether the coordinates are taken from (and applied to) the local or the global coordinate system. In most cases, you will want the global system btw.
On the Translation and Rotation sections, parameters for each axis have to be defined (unless you set the "Same values for all axes" flag, in which case the X (or, in case of rotation, H) values are applied to all other axes as well).
Note that the input fields are automatically deactivated when unused: if "Same values for all axes" is set, only the first axis is editable, and if only 2 controllers are used, the values for the other two are grayed out.
Each axis has 6 parameters: four weights for the four controllers, one factor, and one offset. Factor and offset are applied after the position is determined from the controllers. They have to be used with care and are added here for special purposes; normally you will want to set the factor to 1 and the offset to 0, which are the neutral values.
If you want to position one element between two others, the deed theoretically could be done with one value (as seen in other plugins ;-). This value would be some percentage between 0 and 100, with 0 setting the target at the position of controller 1, and 100 setting the target at the position of controller 2. With an increasing value, the target moves from controller 1 to controller 2. At 50%, the target sits right between both controllers. Simple as one-two-three.
However, this single value concept does not work if there are more than 2 controllers. Therefore, we work with weights. Each weight determines how strong the respective controller affects the target. Obviously, a weight of 1 at each controller will keep the target right between them. Likewise, it is easy to see that, if controller 1 has a weight of 4, it influences the target four times as much as controller 2 with a weight of 1.
But if you start playing with a simple two-controller scenario, you will soon encounter some seemingly weird behaviour. Set the controller weights to 5/1 (weight 5 on controller 1, weight 1 on controller 2), 4/1, 3/1, 2/1 and 1/1 for a target, and observe how the target is positioned. Apparently, although the weight on controller 1 is always increased by 1, the distance between positions increases! If you set one target on each of these positions, the positions will not have the same distance from each other...
Why? Very simple: because the total weight changes! Setting the weights to 5/1 means a total weight of 6. Weights of 1/1 on the other hand result in a total weight of 2. If the weight sum changes, the resulting positions are no longer comparable!
Hey, that sounds like higher mathematics. But as the demo scenes show, equidistant target objects between two controllers are possible:
The trick is to keep the total weight constant. Imagine the total weight as 100%, and distribute this weight on all controllers. Try the weights 10/90, 20/80, 30/70, 40/60 and so on... and you will see that the targets are equidistant! (You can also reduce the relative weights to 1/9, 2/8, 3/7 and so on.)
So, if you go back to the theoretical "one value" percentage example from above, you can do the same with two controllers and weights: Set one controller weight to the percentage, and the other weight to 100 minus percentage. The effect is the same.
With that knowledge, we can also work with three or four controllers and weights of 30/40/30 or 20/40/30/10. Keep the total weight at 100 and distribute this value to all controllers. Experiment a bit and understand the power of the weight concept.
Up to now, the target will always be positioned "between" the controllers. Sometimes, it is necessary that a target is on the far side of a controller instead. How can you achieve that?
Actually, this is easy too: Set a weight smaller than zero. A controller with that weight will affect the target's position "negative". If controller 1 has a weight of 200 and controller 2 a weight of -100 (I chose a weight sum of 100 again!), then the target will appear on the far side of controller 1, opposite of controller 2. You can still move both controllers around.
This is also possible with 3 or 4 controllers, although the effects may not be as intuitive.
The only thing you may not do with weights: the sum of the weights must never be 0 (or near 0). The tag will then write an error to the console.