User Manual

Table Of Contents
We could use the Center input control, along with its preview control, to set an angle and
distance from directly within the viewer using expressions.
1 Right-click the label for the Length parameter, choose Expression from the contextual
menu, and then paste the following expression into the Expression field that appears:
-sqrt(((Center.X-.5)*(Input.XScale))^2+((Center.Y-.5)*(Input.YScale)*(Input.
Height/Input. Width))^2)
2 Next, right-click the label for the Angle parameter, choose Expression from the
contextual menu, and then paste the following expression into the Expression field
that appears:
atan2(Center.Y-.5)/(Input.OriginalWidth/Input.X , .5-Center.X) * 180 / pi
Directional Blur controlled by the Center’s position.
This functions fine, but the controls are confusing. The Center control doesn’t work as the
center anymore, and it should be named “Blur Vector” instead. The controls for the Length and
Angle aren’t meant to be edited, so they should be hidden away, and we’re only doing a linear
blur, so we don’t need the buttons for Radial or Zoom. We just need to choose between Linear
and Centered.
Adding Another Control
For the first task, let’s rename the Center. From the Add Control window, select Center from the
ID list. A dialog will appear asking if you would like to Replace, Hide, or Change ID. We’ll choose
Replace. Now we are editing the Center input. We’ll change the Name to Blur Vector, set the
Type to Point, and the Page to Controls, which is the first tab where the controls are normally.
Press OK, and our new input will appear on our node in the Node Editor. The ID of the control is
still Center, so our SimpleExpressions did not change.
To hide the Length and Angle, we’ll run the UserControls script again. This time when we select
the Length and Angle IDs, we’ll choose Hide in the dialog. Press OK for each.
Finally, to change the options available in the Type, we have two options. We can hide the
buttons and use a checkbox instead, or we can change the MultiButton from four entries to two.
Let’s try both.
Chapter – 59 Editing Parameters in the Inspector 1192