Tracker Link Tools

Nuke Tracker Link Tools – Code

Tracker Link Tools Interface
It is often the case that you need link things to a Tracker node. It could be a Roto, RotoPaint, or SplineWarp layer that has linked transforms, or a Tracker node that links its transforms to a parent tracker. Tracker Link Tools is a script to do these things.

The script has two functions. The first is to create a linked Roto node. If you have a tracker node selected, and have installed it as described, press Alt-O, and a Roto node will be created with a layer linked to the selected Tracker node. Sometimes you might want to create a linked layer in an existing Roto, RotoPaint or SplineWarp node. No problem, just select as many target nodes as you want, along with your Tracker node, and press Alt-O to run the script. All selected target nodes will have a linked layer added to them.

The other function is to create a linked Transform node. Sometimes you have a Tracker or a Transform node, and you need to apply the same transformation in many places in your Nuke script. You could create many copies of your original Tracker or Transform node, or you could use this script to create a TransformLink node. Select as many parent Tracker or Transform nodes, and press Alt-L. Linked Transform nodes will be created for each.

The TransformLink node has some extra features compared to a regular Transform node. By default, when it is created, it will be linked using a relative transform. This means that on the identity frame specified, the transformation will be zeroed out. This identity frame is separate from the parent Tracker node. You can switch the node from Matchmove to Stabilize functionality by checking the ‘invert’ knob.

Sometimes, especially if you are linking to a parent node that is a Transform, you will just want to inherit the exact transformation of the parent node. If this is the case, you can click the Delete Rel button, and it will remove the relative transformation. Once the TransformLink node is created, you can also use the Set Target button to link it to a different Tracker or Transform node. You can also bake the expressions on the transform knobs with the Bake Expressions button.

This node might seem redundant to the built-in functionality of Nuke7’s Tracker node that lets you create a Matchmove or Stabilize transform. Unfortunately the transform nodes that are created using this method are burdened by excessive python code on the ‘invert’ knob, which is evaluating constantly, degrading Nuke’s UI performance. Turn on “Echo python commands to output window” in the Preferences under Script Editor. In a heavy script with a few of these nodes, you will probably notice stuttery UI responsiveness and freezing.

Put the file somewhere in your nuke path. You can add the script as commands to your Nodes panel. This code creates a custom menu entry called “Scripts”. I have them set to the shortcuts Alt-O and Alt-L.

import tracker_link
nuke.toolbar('Nodes').addMenu('Scripts').addCommand('Link Roto', 'tracker_link.link_roto()', 'alt+o')
nuke.toolbar('Nodes').addMenu('Scripts').addCommand('Link Transform', 'tracker_link.link_transform()', 'alt+l')

This entry was posted in Tools and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • Frank

    Just watched your tutorial on outputting paint strokes independantly, great tut! I was wondering though, is there a way to be able to do this and still be able to paint progressively?

    • jedypod

      Hey Frank, thanks for the question.
      I’m not sure I understand completely. By painting progressively, do you mean painting frame by frame? If you are painting frame by frame, you wouldn’t need to stabilize your paint through a tracker.

      If you mean painting sequential patches though, using tracking data would be very useful. For example if you had a complex deforming surface, and you were tasked with removing a piece of it, you might paint a clean frame every 5 frames, and then morph from one clean frame to the next within a patch. In this case, if you have tracking data, you can leverage this to make the in-between for your morph easier and more accurate.

      Let me know if I’m misunderstanding you!

      • Frank

        Sorry for the late reply (and the vague explanation). What i mean by progressive is: after painting a stroke, the new pixels would be sourced for your next stroke, and not the original image.. i.e. being able to progressively source over your existing paint strokes and use the resulitng image as the new source and not keep sourcing bg1 which is not being updated with the new stokes.. My understanding is that when using your method, rotopaint source has to be set to bg?? What i was asking is if there is a way to be able to have rotopaint set to fg and still use this method?

        Kind Regards

        • jedypod

          Ah thanks for elaborating, I understand what you mean now.

          There is no way to paint progressively using the BG input with the Nuke’s rotopaint toolset. The only workaround would be to stack the output of each rotopaint node over the input of the next. You could do this by merging the output of each of your rotopaint nodes over the source you are using for your BG and use this as the BG1 source for the your next rotopaint node. This way you could paint some, and then bake in those this paint, create a new node sampling the output of your previous rotopaint node’s work as your new source. If you keep this in a separate tree, you can merge each individual rotopaint over your plate, or stack them all up and merge them at once, whatever suites your purposes.

          All that said, there’s a time and a place for just plugging a rotopaint node in set to FG and painting away.

          Happy painting!

          • Frank

            Awesome! Thanks again!

            btw, I ended up using a rotopaint set to FG, difference matting this with the plate, grading the alpha all the way up with an expression, premulting this and merging.

            Thanks for the perspective!
            looking forward to more tuts