What the 2D Tracker does in Nuke

Nuke's 2D Tracker follows a moving object in your footage and records its position frame by frame. You can then link that motion data to a 3D object — a camera, light, or geometry — so the object moves in sync with what the tracker found. This is useful when you need a 3D element to follow something that's moving in your shot, like a person's face, a car, or a hand.

The tracker works by analyzing pixel patterns in a small region of your image and finding where that same pattern appears in the next frame. It does this automatically across your entire sequence, building a motion path. Once you have that path, you export it as data and connect it to your 3D object's position or rotation.

Key Takeaways

  • The 2D Tracker node finds motion in 2D footage by matching pixel patterns frame to frame, then records the X and Y position of that motion.
  • You need to define a search region (the area the tracker looks in) and a track region (the pattern it's looking for) before tracking begins.
  • After tracking completes, you export the motion data and connect it to a 3D object using an expression or by linking directly to the tracker output.
  • Tracking fails when the pattern changes too much, the object moves too fast between frames, or lighting shifts dramatically — you can fix this by adjusting region size or tracking in smaller chunks.
  • The most common setup is tracking a point on an actor's face or body, then using that data to position a 3D camera or light that should follow them.

Setting up the tracker node and defining regions

Start by placing a Tracker node in your node graph after your source footage. Connect your clip to the Tracker's input. Open the Tracker node's properties panel. You'll see a viewer window showing your footage with two overlapping boxes — the outer box is the search region, the inner box is the track region.

The track region should be a small, distinctive area of your footage — a corner of an eye, a button on a shirt, a mark on an object. Make it roughly 30 to 50 pixels wide. The search region should be larger, typically 2 to 3 times the size of the track region, because the tracker needs room to search for where the pattern moved. Position both boxes over your chosen feature in the first frame by clicking and dragging in the viewer.

Avoid tracking flat, featureless areas like a blank wall or clear sky. The tracker needs contrast and detail to lock onto. If your chosen feature is too small or blurry, expand the track region slightly, but keep it tight enough that it won't accidentally match a different part of the image.

Running the track and checking for drift

Once your regions are set, click the Track Forward button to begin. The tracker will process every frame from your current position to the end of the sequence. Watch the viewer as it works — you'll see the track region box follow your feature across the screen. The tracker displays a correlation score for each frame, usually shown as a number between 0 and 1. Scores above 0.8 are generally reliable; anything below 0.7 means the tracker is struggling.

When tracking finishes, scrub through the timeline and look for drift — places where the tracked box has slipped off your target feature. Drift often happens when the feature rotates, changes size, or when lighting shifts. If you see drift in just one or two frames, you can manually correct those frames by moving the track region box to the correct position and clicking Set Keyframe. If drift is widespread, stop and adjust your approach.

Common reasons for drift include the search region being too small (the tracker can't find the pattern), the track region being too large (it matches the wrong part of the image), or the feature itself changing too much between frames. If your actor blinks or turns their head sharply, the tracker may lose the face entirely — in that case, you may need to track in sections, stopping before the problem frame and resuming after.

Exporting tracker data to use on a 3D object

After a successful track, right-click on the Tracker node and select Export Tracking Data. Choose a location and filename. Nuke will save a text file containing the X and Y position of your tracked point for every frame. This file is what you'll use to drive your 3D object's movement.

In your 3D workspace, create or select the object you want to move — a Camera, Light, or Axis node. Open its properties. For a Camera or Light, you'll typically want to control the Translate X and Translate Y values. For an Axis (a 3D point), you might control Translate or Rotate depending on what you're doing.

Click the expression editor button (usually a small icon next to the parameter value) and type an expression that reads the tracker data. A common expression is curve('path/to/your/tracker/file.txt', frame, 1) for the X channel and the same with channel 2 for Y. Some studios use Python scripts to automate this step, but the curve() function is the standard built-in method.

Adjusting scale and offset when the motion doesn't match

When you first connect the tracker data to your 3D object, the motion may not line up correctly. The 3D object might move too much, too little, or in the wrong direction. This happens because the tracker records pixel coordinates from your 2D footage, but your 3D scene may have different scale or orientation.

Use the Offset and Scale parameters in your expression to correct this. If the 3D object moves twice as far as it should, divide the tracker value by 2. If it moves in the opposite direction, multiply by -1. For example: curve('tracker.txt', frame, 1) * 0.5 - 100 would scale the motion to half strength and shift it left by 100 pixels.

Test by playing back your sequence and comparing the 3D object's movement to the original footage. Adjust the scale and offset values until they match. This is often a trial-and-error process, but once you get it right, the 3D object will follow your tracked feature precisely.

Tracking multiple points for rotation and scale

If you need your 3D object to not just move but also rotate or scale based on your footage, track two or more points instead of one. For example, track the top and bottom of a person's head to detect head tilt, or track opposite corners of a moving box to detect rotation and perspective change.

Create multiple Tracker nodes, each with its own track and search regions. Track each point separately. Then in your 3D object, use expressions that calculate the angle or distance between the tracked points. If point A is at (100, 50) and point B is at (150, 100), the angle between them is atan2(B.y - A.y, B.x - A.x). The distance is sqrt(pow(B.x - A.x, 2) + pow(B.y - A.y, 2)). These values can then drive your 3D object's rotation or scale.

This approach is more complex but gives you much richer control. A common use case is tracking an actor's eyes to position a 3D camera that looks at them, or tracking a vehicle's corners to position a 3D shadow that matches the vehicle's tilt and perspective.

Troubleshooting common tracking problems

If your tracker keeps losing the feature, the most common fix is to make the track region smaller and more distinctive. A 20-pixel square with high contrast will track better than a 60-pixel square of similar texture. If the feature itself is small, zoom in on your footage in the Tracker viewer so you can see what you're tracking more clearly.

If the tracker drifts gradually over many frames, your search region may be too large or your track region too generic. Tighten both. If the tracker works for the first 50 frames and then fails, the feature may be rotating or changing size — in that case, stop the track at frame 50, manually adjust the track region to match the new appearance of the feature, and resume tracking from frame 51.

If your 3D object's motion is jittery or noisy, the tracker may be picking up slight variations in the feature's appearance. You can smooth the exported tracker data by applying a median or average filter in a text editor, or by using Nuke's Smooth node on the tracker output before connecting it to your 3D object. A small amount of smoothing often makes the result look more natural.

Frequently Asked Questions

Can I track a feature that rotates or changes size?

The standard 2D Tracker can follow rotation and scale to some degree, but it works best on features that stay roughly the same size and angle. If your feature rotates sharply or scales dramatically, the tracker will likely drift. For complex motion, consider using Nuke's CornerPin tracker instead, which tracks four points and handles perspective changes better.

What if the tracker loses the feature partway through?

Stop the track at the last good frame, manually reposition the track region to match where the feature is now, and resume. You can also track backwards from a later frame if the feature reappears. Nuke will merge the forward and backward tracks into one continuous path.

How do I know if my tracker data is accurate?

Play back your sequence with the 3D object visible and compare it to the original footage. If the 3D object stays locked to the tracked feature throughout the shot, your data is good. If it drifts or slides, adjust your scale and offset values or re-track with better regions.

Can I use the 2D Tracker on moving camera footage?

Yes, but the tracker will record the motion of your feature relative to the camera, not its absolute position in the world. This is usually what you want — if a person walks across the frame, you track them and your 3D object follows them on screen. If you need to stabilize the camera motion first, use Nuke's Stabilize node before tracking.

What's the difference between tracking and match-moving?

2D tracking records the position of a point in your footage. Match-moving (or camera tracking) solves for the 3D camera's position and rotation based on points in the footage. Nuke's 3D Camera Tracker does match-moving; the 2D Tracker is simpler and works when you just need to follow a single moving object.