Auto orient – Apple Shake 4 User Manual

Page 978

Advertising
background image

978

Chapter 32

The Cookbook

To burn the path in:

1

Set timeRange in the Globals tab (1-50, for example).

2

Right-click over the xPan expression, then choose Save Expression from the shortcut
menu.

3

In the lower-right corner of the Browser is a setting for Auto or Raw. Set it to Raw.

4

Enter a name for your curve, for example, “curveX.txt.”

5

Do the same thing for yPan, saving it as “curveY.txt.”

6

Create a second Pan node.

7

Right-click, then select Load Expression on the xPan parameter.

8

Set your format in the Browser as Raw.

9

Do the same for yPan.

Auto Orient

This script can be found in doc/html/cook/scripts/autoorient.shk.

This script demonstrates how to set up a transform so that an element automatically
rotates according to the tangent of the move. Although you can create this effect with
one node, it is better to use two so that you can continue to modify the position
without accidentally eliminating the expression to do the rotation. If you want to
animate or modify the rotation, insert a second Rotate node—the transforms
concatenate.

The rotation is determined by obtaining the position just before and just after the
current node. This is done by using the @@ time notation: (xPan@@time-.5) returns the
xPan position half a frame earlier. These coordinates are then fed into the atan2d
function which returns the angle between two points.

Advertising