Skip to content

Instantly share code, notes, and snippets.

@jedypod
Last active November 24, 2021 11:49
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jedypod/6969051 to your computer and use it in GitHub Desktop.
@jedypod
Copy link
Author

jedypod commented Oct 14, 2013

About:
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.

Installation:
Put link_tools.py 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', 'link_tools.link("roto")', 'alt+o')
nuke.toolbar('Nodes').addMenu('Scripts').addCommand('Link Tool', 'link_tools.link()', 'alt+l')

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