You are here: User Guide > Nuke > Tracking and Stabilizing > Applying Tracking Data Using Linking Expressions

Applying Tracking Data Using Linking Expressions

Nuke’s CornerPin2D and Stabilize2D nodes are specifically designed to receive tracking data by linking expressions, but you can apply tracking data in this manner to virtually any Nuke node. For example, you might animate a Bezier or a B-spline shape with tracking data by entering linking expressions into the RotoPaint node’s transformation parameters. You can also apply tracking data to individual points.

This section explains the basic procedure for applying tracking data to any node via linking expressions.

Creating Linking Expressions

The Tracker node’s Tracker panel displays data related to the position of each track anchor over time (tracks’ x and y fields). This is the data that you most typically apply to other nodes.

To Drag and Drop Tracking Data:

1.   Display both the Tracker parameters and the parameters to which you wish to apply the tracking data (the destination control - for example, a RotoPaint node’s translate control).
2.   Select the required track from the Tracks list. Only one track can be linked per control.
3.   Ctrl+drag (Cmd+drag on a Mac) from the source control animation button to the destination control animation button.

When you release, the destination control will turn blue, indicating an expression has been applied. In this case, the drag and drop action has created a linking expression resembling the following example:

Tracker1.tracks.1.track_x

TIP:  You can also apply tracking (or other transform) data to individual RotoPaint, SplineWarp, or GridWarp points (this is sometimes called per vertex tracking). To do so, Ctrl/Cmd+drag and drop the track’s animation button on a RotoPaint, SplineWarp or GridWarp point in the Viewer.

You can add other components to this linking expression as necessary. For example, you might add a spatial offset to the linking expression by subtracting out the initial frame’s tracking values, in which case the final expression would resemble the following:

Tracker1.tracks.1.track_x-Tracker1.tracks.1.track_x(1)

See Expressions for more information. Once you enter the linking expression, the destination parameter turns blue.

To Link Animated Parameters with a Tracker Node

You can also link controls with the Tracker node if you use the Link to option in the Animation menu. For example, to link the translate control of the Roto node with a Tracker node, do the following:

1.   Create the Tracker node you want to link to.
2.   Go to Tracker’s Transform tab and enable live-link transform.

This control enables Tracker to update dynamically as the expression link changes.

3.   On the Transform tab of the Roto node’s properties panel, click on the translate animation menu.
4.   Select Link to > Tracker linking dialog.
5.   Select the Tracker node you want to use in the tracker node dropdown and in the link to dropdown, select whether you want to link to the position of the track, the translate values of the track, or treat the translate value as an offset.
6.   Select which tracks you want to use by checking the track boxes. The Expression field updates with the appropriate expression syntax. If you select more than one track, the tracks are averaged, for example:

(Tracker1.tracks.1.track_x + Tracker1.tracks.2.track_x)/2

7.   Then click OK, and your linking is done.

Your Bezier shape’s translate value now changes when the Tracker value is changed.