Instantly share code, notes, and snippets.

@jedypod /Link Tools
Last active Nov 30, 2018

What would you like to do?

This comment has been minimized.

Copy link

jedypod commented Oct 14, 2013

This script is a set of tools to expression link Transform, Tracker, Roto, and Camera nodes. This is advantageous so that you don't have tons of copies of knobs with animation curves, which can increase your script size and slow things down. This tool lets you easily create expression-linked Transform and Roto nodes that are linked to a master Tracker node, or copies of a Camera that are expression-linked to a master Camera in your script.

It is often the case that you need to create a Roto or RotoPaint node that has transforms linked to a tracker. The Create Linked Roto button creates a new Roto node with a layer that is linked to the tracker's transforms. Or, if a Roto or RotoPaint node is selected, a linked layer will be added to that node.

The Create Linked Transform button creates a transform node that is linked to the tracker. The created transform node lets you specify the identity transform frame separate from the Tracker node, and lets you bake the expression to keyframes, or re-link to a different tracker node. The transform can be switched from Matchmove to Stabilize by checking the invert checkbox.

This might seem redundant to the built-in functionality of Nuke7's Tracker node that lets you create a Matchmove or Stabilize transform. Unfortunately the transforms that are created using this method are burdened by python code that markedly degrades Nuke's UI performance. Turn on "Echo python commands to output window" in the Preferences under Script Editor in a script with a few of these nodes, and see what I mean.

Put 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 for roto and Alt-L for generalized link (works with tracker, transform, and camera nodes).

import link_tools
nuke.toolbar('Nodes').addMenu('Scripts').addCommand('Link Roto', '"roto")', 'alt+o')
nuke.toolbar('Nodes').addMenu('Scripts').addCommand('Link Tool', '', 'alt+l')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment