Skip to content

Instantly share code, notes, and snippets.

@jedypod
jedypod / DOLLAR_GUI_HANDLER.nk
Created July 7, 2016 16:40
DOLLAR_GUI_HANDLER is a node to remove $gui expressions on Nuke nodes in a script. It is based on $gui Expression Finder by Falk Hofmann, but the code is re-written to be more robust, and to have functionality to remove $gui expressions as if the script were being rendered on the farm, instead of reverting back to the GUI values.
NoOp {
name DOLLAR_GUI_HANDLER
tile_color 0xd94848ff
hide_input true
addUserKnob {20 Handler l "\$gui Handler"}
addUserKnob {1 nodelist}
nodelist "H_high_low_switch.Switch1, RF_Yorktown_DEFOCUS.SHIT_SWITCHER, RF_Yorktown_BG1.ScanlineRender4, ScanlineRender1"
addUserKnob {26 ""}
addUserKnob {22 find_gui_nodes l "Find \$gui Nodes" T "# Find all nodes with knobs that have \$gui expressions\nnodelist = \[]\nfor node in nuke.allNodes(recurseGroups=True):\n for knob in node.knobs():\n if node\[knob].hasExpression():\n if '\$gui' in node\[knob].toScript():\n if node not in nodelist:\n nodelist.append(node)\n\nnodelist_comma = ', '.join(\[item.fullName() for item in nodelist])\nprint nodelist_comma\nnuke.thisNode()\['nodelist'].setValue(nodelist_comma)" +STARTLINE}
addUserKnob {22 remove_gui_expression l "Remove \$gui Expression" -STARTLINE T "# Remove \$gui expression\n#thisNode = nuke.selectedNode()\nthisNode = nuke.thisNode()\nnodelist_comma = thisNod
@jedypod
jedypod / storefunc.py
Created March 9, 2017 02:28 — forked from fredrikaverpil/storefunc.py
Store function on Nuke NoOp (or on nuke.root()) node and have it made available upon loading of script
"""Store function on node
Usage example:
.. code-block::
# Control node
ctrl_node_name = 'MY_SCRIPT_NODE' # if None, store on nuke.root()
# Define your functions and add them to the dictionary
@jedypod
jedypod / ColorTracker.nk
Last active October 19, 2019 05:07
ColorTracker: A wrapper for the CurveTool, which allows you to analyze color change over time of an input, and apply that data to a grade in matchmove or stabilize mode around a specified reference frame. Because I am bad at remembering math.
Group {
name ColorTracker
addUserKnob {20 ColorTracker}
addUserKnob {26 instructions_text l <b>Instructions: T "1). Stabilize your plate around the area you want to track\n2). Crop your plate to just the area you want to analyze\n4). Press Track Color to analyze the footage\n5). Create a matchmove or stabilize grade, and specify your reference frame\n6). You can scale the curve around a specified pivot value on the grade node \n using the color_pivot and color_mult knobs in the ColorTrack tab"}
addUserKnob {26 ""}
addUserKnob {26 label_trackcolor l "<b>Track Color" T " "}
addUserKnob {41 track_color l "Track Color" t "This button will track the color change over the specified framerange and put the data into the intensitydata knob." T CurveTool.go}
addUserKnob {41 intensitydata T CurveTool.intensitydata}
addUserKnob {26 ""}
addUserKnob {26 label_apply_color_track l "<b>Apply Track" T " "}
@jedypod
jedypod / rsync-time-machine.py
Created April 6, 2017 22:26
My linux rsync time machine script
#!/usr/bin/python
"""
Karl's unix/rsync time-machine script.
Maintains daily and monthly snapshots of a directory tree, hard linked to save
space when files don't change.
Inspired by http://www.mikerubel.org/computers/rsync_snapshots/, but using
more robust coding practices.
Features:
@jedypod
jedypod / DofCalc.nk
Last active December 4, 2022 14:58
DofCalc visualizes the near and far limit depth of field given a specified lens focal length, aperture, filmback size, and focus distance. Useful for visualizing plausible focus ranges given a matchmove camera and lidar scan.
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name DofCalc
label "<left>\nfocal length: \[format \"%.0f\" \[value f]]\nf-stop: \[format \"%.2f\" \[value N]]\nsubject dist: \[format \"%.2f\" \[value s]]\n\nhyperfocal dist: \[format \"%.2f\" \[value H]]\n---------------------------\ndof: \[format \"%.2f\" \[value dof]]\ndof near: \[format \"%.2f\" \[value Dn]]\ndof far: \[format \"%.2f\" \[value Df]]"
addUserKnob {20 DofCalc}
addUserKnob {4 depth_unit l "depth unit" t "Set your depth unit" M {mm cm dm m inch ft}}
depth_unit ft
addUserKnob {41 s l subject_distance T VAR.s}
addUserKnob {41 f l focal_length T VAR.f}
@jedypod
jedypod / PNoise.nk
Created June 21, 2017 17:27
One position noise to rule them all.
set cut_paste_input [stack 0]
push $cut_paste_input
add_layer {Pref Pref.red Pref.green Pref.blue Pref.alpha}
Group {
name PNoise
addUserKnob {20 PNoise}
addUserKnob {41 p_channel l "position data" T _POSITION_DATA_.in}
addUserKnob {41 output_channel l output -STARTLINE T _NOISE_OUT_.out}
addUserKnob {6 unpremultiply +STARTLINE}
unpremultiply true
@jedypod
jedypod / 0_reuse_code.js
Created September 4, 2017 21:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jedypod
jedypod / ToeReverse.nk
Last active January 18, 2018 15:31
A reversible Toe.
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name ToeReverse
tile_color 0x7aa9ffff
addUserKnob {20 Toe}
addUserKnob {18 lift}
lift 0
addUserKnob {6 lift_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
addUserKnob {18 pivot}
This file has been truncated, but you can view the full file.
##############################################################
# TMUX CONF JEDEDIAH
##############################################################
set-option -g prefix M-a
unbind-key M-a
bind-key M-a send-prefix
set -g base-index 1