Transforming and Animating Warps and Morphs
Unless you are warping or morphing a still image, you’ll probably need to transform or animate warp operations. The Tracker and PlanarTracker nodes can help automate transformations, and you can use Expressions and the GridWarp and SplineWarp Properties panel controls as well. See Transforming Warps and Animating Warps.
Transforming Warps
You can transform grids and splines in the same way as any other element in Nuke (see Temporal Operations), but you can also link control points to the Tracker and PlanarTracker nodes to automate any transforms you require. Once you have a suitable track, you can use the animation data to control points on grids and curves.
Using the Tracker Node
1. | To generate tracking data, see Tracking and Stabilizing . |
2. | Make sure both the Tracker and the GridWarp/SplineWarp properties panels are open, then either: |
• Ctrl/Cmd+drag the animation button from the Tracker node properties on top of the individual grid/curve point in the Viewer. When you release the mouse, the point follows the animation from the Tracker node,
OR
• Right-click on the required control point and select Link to > Tracker1 and select the required transform type.
Using the PlanarTracker Node
1. | To generate PlanarTracker data, see Tracking with PlanarTracker. |
2. | Use the Draw Boundary button to create a source grid roughly the same shape as the tracked plane, or draw similar splines. |
3. | On the GridWarp/SplineWarp and RotoPaint Transform tabs, open up the Transform tab extra matrix. |
4. | On the RotoPaint Transform tab, select PlanarTrackerLayer1 in the curves list. |
5. | Copy and paste the extra matrix animation from RotoPaint to the GridWarp/SplineWarp extra matrix. |
6. | Play through the sequence to check that the grid or splines follow the plane. |
Using Expressions with GridWarp
As well as using other nodes to control points, you can do the inverse, using expressions to link control points and their tangents to other operations.
The expressions take the following form:
• GridWarp3_1.destination_grid_col.1.2.pos.x
• GridWarp3_1.destination_grid_col.2.2.tangent.1.x
Note: Control points are indexed starting from the bottom left 1.1, in x.y order, and tangent points are labelled 0, 1, 2, and 3 corresponding to north, south, east, and west respectively.
It’s worth mentioning that in order to get the true position of a tangent, not its offset value, you need to concatenate the pos and tangent expressions. For example:
GridWarp3_1.destination_grid_col.2.2.pos.x + GridWarp3_1.destination_grid_col.2.2.tangent.4.x
Note: You can only modify tangent positions using the Curve Editor.
For more information, refer to Expressions.
Animating Warps
In the GridWarp and SplineWarp node’s properties panels, there are controls for animating both the source and the destination grids or shapes. Here, we first look at the GridWarp node and then the SplineWarp node. The instructions assume you know how to warp a still image using these nodes (if not, refer to Warping Images Using the GridWarp Node and Warping an Image Using the SplineWarp Node).
To Animate a Warp Using the GridWarp Node
1. | While viewing the source image, adjust the source grid as necessary (see Warping Images Using the GridWarp Node for information on how to do this). |
If autokey is enabled, key frames are added every time you adjust the grid. Otherwise, click the add key button under Source Grid. This saves the current grid as a key shape.
2. | Move to a new frame and adjust the source grid accordingly. A new key shape is set automatically. |
3. | Repeat the previous step as necessary. If you need to delete a key shape, scrub to the frame where you set it and click delete key under Source Grid. |
4. | Hide the source grid and display the destination grid. |
5. | While viewing the output of the GridWarp node, adjust the destination grid until you are happy with the warp. |
If autokey is enabled, key frames are added every time you adjust the grid. Otherwise, click the add key button under Destination Grid. This saves the current grid as a key shape. Click the set button under Destination Grid. The current grid is saved as a key shape.
6. | Move to a new frame and adjust the destination grid again. The modified grid is automatically set as a key shape. |
7. | Repeat the previous step until you are happy with the animated warp. |
To Animate a Warp Using the SplineWarp Node
1. | Create the required curves as described under Warping an Image Using the SplineWarp Node. |
If autokey is enabled, key frames are added every time you adjust a shape. Otherwise, click the add key button with A warped selected. This saves the current shape as a key frame.
2. | Move to a new frame and adjust the shapes accordingly. New key shapes are set automatically. |
Repeat the previous step as necessary. If you need to delete a key shape, scrub to the frame where you set it and click delete keywith A warped selected.
Linking Transforms Using the SplineWarp Node
Transforms applied in the properties panel Transform tab can be expression linked with other shapes in the curves list using the transform linked toggle.
1. | Create the required transform on the source shape. |
2. | Click the transform linked toggle in the curves list. |
A menu displays the available shapes and transform types.
You can link all transform types associated with the source shape or be selective, such as all but extra matrix.
3. | In the example, any scale keyframes added to the l_left_nose shape are applied equally to the l_head shape. |
4. | If you want to remove a link, click the transform linked toggle for the required shape, select the link, and click remove link. |