Skip to content

Instantly share code, notes, and snippets.

@BenMcEwan
Last active May 9, 2018 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenMcEwan/fefe9d0cf856cdb6e2d7db7d53bca0d2 to your computer and use it in GitHub Desktop.
Save BenMcEwan/fefe9d0cf856cdb6e2d7db7d53bca0d2 to your computer and use it in GitHub Desktop.
# --------------------------------------------------------------
# EnableTrackerTRS.py
# Version: 1.0.0
# Last Updated: January 11th, 2018
# --------------------------------------------------------------
# --------------------------------------------------------------
# USAGE:
#
# A simple script that enables all T R S knobs in a selected tracker node
# --------------------------------------------------------------
import nuke
def EnableTrackerTRS():
#ENABLE TRANSLATE, ROTATE AND SCALE IN SELECTED TRACKER
t = [8, 39, 70, 101, 132, 163, 194, 225, 256, 287, 318, 7, 38, 69, 100, 131, 162, 193, 224, 255, 286, 317, 6, 37, 68, 99, 130, 161, 192, 223, 254, 285, 316, 349, 380, 411, 442, 473, 504, 535, 566, 597, 628, 659, 348, 379, 410, 441, 472, 503, 534, 565, 596, 627, 658, 347, 378, 409, 440, 471, 502, 533, 564, 595, 626, 657]
try:
nuke.selectedNode()
except:
nuke.message("Select a Tracker to enable Translate, Rotate & Scale")
if nuke.selectedNode().Class() == 'Tracker4':
for n in t:
nuke.selectedNode()['tracks'].setValue(True, n)
else:
nuke.message("Select a Tracker to enable Translate, Rotate & Scale")
# Add the following to menu.py
import EnableTrackerTRS
utilitiesMenu = nuke.menu('Nuke').addMenu('Utilities')
utilitiesMenu.addCommand('Enable Tracker T-R-S', 'EnableTrackerTRS.EnableTrackerTRS()')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment