Skip to content

Instantly share code, notes, and snippets.

Jed Smith jedypod

Block or report user

Report or block jedypod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jedypod
jedypod / ColorTracker.nk
Last active Oct 19, 2019
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.
View ColorTracker.nk
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 / storefunc.py
Created Mar 9, 2017 — forked from fredrikaverpil/storefunc.py
Store function on Nuke NoOp (or on nuke.root()) node and have it made available upon loading of script
View storefunc.py
"""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 / DOLLAR_GUI_HANDLER.nk
Created Jul 7, 2016
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.
View DOLLAR_GUI_HANDLER.nk
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 / BreakdownTransition.nk
Last active Mar 25, 2017
Breakdown Transition
View BreakdownTransition.nk
Group {
name BreakdownTransition
addUserKnob {20 Breakdown}
addUserKnob {4 transition_type l "Transition Type" M {Dissolve Wipe "Depth Wipe"}}
transition_type Wipe
addUserKnob {3 start_frame l "Start Frame" t "The frame to start the transition on"}
start_frame 1001
addUserKnob {22 set_current_frame l Current t "Sets the start frame to the current frame" -STARTLINE T "n = nuke.thisNode()\nn\['start_frame'].setValue(nuke.frame())"}
addUserKnob {3 transition_length l "Transition Length"}
transition_length 6
@jedypod
jedypod / TonemapFilmic.nk
Created Jan 24, 2016
Tonemap Filmic - Implementing John Hable's Filmic Tonemapping algorithm as a Nuke gizmo.
View TonemapFilmic.nk
Group {
name TonemapFilmic
help "Implementing John Hable's Filmic Tonemapping algorithm as a Nuke gizmo.\n\nhttp://filmicgames.com/archives/75\nhttp://www.slideshare.net/ozlael/hable-john-uncharted2-hdr-lighting\n\n## Filmic Tonemapping\nA = Shoulder Strength\nB = Linear Strength\nC = Linear Angle\nD = Toe Strength\nE = Toe Numerator\nF = Toe Denominator\n\tNote: E/F = Toe Angle\nLinearWhite = Linear White Point Value\n\nF(x) = ((x*(A*x+C*B) + D*E) / (x*(A*x+B) + D*F)) - E/F\nFinalColor = F(LinearColor)/F(LinearWhite)\n\nA = 0.22\nB = 0.30\nC = 0.10\nD = 0.20\nE = 0.01\nF = 0.30\nLinearWhite = 11.2\nThese numbers are assuming linear source data."
addUserKnob {20 Tonamap l Tonemap}
addUserKnob {26 ""}
addUserKnob {7 exposure t "Adjust the exposure before the tonemap in stops." R -4 4}
addUserKnob {41 shStr l "Shoulder Strength" T Expression_Filmic_Tonemap.shStr}
addUserKnob {41 linStr l "Linear Strength" T Expression_Filmic_Tonemap.linStr}
addUserKnob {41 linAngle l "Linear Angle" T Expression_Filmic_T
@jedypod
jedypod / render_writes_with_ranges.py
Last active Jan 27, 2016
Render Selected Writes with Individual Frame Ranges - renders each selected write node with the input frame range of that node instead of a single framerange.
View render_writes_with_ranges.py
import nuke
# nuke.menu('Nuke').findItem('Render').addCommand('Render Selected with Ranges', 'render_writes_with_ranges.render()')
def render():
gui_render = False
write_nodes = nuke.selectedNodes()
write_nodes.sort()
# Get all writes and frame ranges
writes = dict(zip([w for w in write_nodes], [w.frameRange() for w in write_nodes]))
@jedypod
jedypod / GrainResponse.nk
Last active May 31, 2017
Simple grain node with with intensity response LUT adjustment.
View GrainResponse.nk
Group {
name GrainResponse
help "Adds synthetic grain. Push \"presets\" to get predefined types of grain, these are the correct size for 2K scans.\n\nYou can also adjust the sliders to match a sample piece of grain. Find a sample with a rather constant background, blur it to remove the grain, and use as input to this. View with a wipe in the viewer so you can make a match. It helps to view and match each of the red, green, blue separately."
addUserKnob {20 GrainTab l Grain}
addUserKnob {3 seed t "Change this value to make different instances of this operator produce different noise"}
seed 134
addUserKnob {35 presets l "" -STARTLINE M {"presets/Kodak 5248" "knobs this \{red_size 3.30 green_size 2.90 blue_size 2.5 red_i 0.60 green_i 0.60 blue_i 0.60 red_m 0.42 green_m 0.46 blue_m 0.85 black 0.00 label \{Kodak 5248\}\}" "presets/Kodak 5279" "knobs this \{red_size 2.70 green_size 2.60 blue_size 2.40 red_i 1.00 green_i 0.76 blue_i 0.65 red_m 0.37 green_m 0.60 blue_m 1.65 black 0.00 label \{Kodak 5279\}\}" "p
@jedypod
jedypod / reformat_paint.py
Created Nov 18, 2015
Scales all strokes in a rotopaint node by a specified scale: expects a layer full of strokes that have all been scaled by the specified amount from a center of 0,0
View reformat_paint.py
## Adjust size of all brush stokes in a layer
## Expects a single layer in the rotopaint node containing strokes that want to be scaled.
## This script scales the brushsize and source transform by the scale value
_SCALE_ = 1.53706293
rn = nuke.selectedNode()
cKnob = rn["curves"]
rootLayer = cKnob.rootLayer
View node_handler.py
import nuke, operator
'''
## Add these lines to your menu.py after putting this file somewhere in your NUKE_PATH
# Manipulate nodes in the node graph
import node_handler
nuke.menu('Nuke').addCommand('Edit/Node/Move/Right', 'node_handler.move(1,0)', 'alt+meta+Right')
nuke.menu('Nuke').addCommand('Edit/Node/Move/Left', 'node_handler.move(-1,0)', 'alt+meta+Left')
nuke.menu('Nuke').addCommand('Edit/Node/Move/Up', 'node_handler.move(0,-1)', 'alt+meta+Up')
@jedypod
jedypod / OpticalZDefocus.md
Last active Jul 2, 2019
OpticalZDefocus is a physically accurate ZDefocus, which controls circle of confusion (coc) size based on lens geometry using the depth of field equation. Set your lens and film-back characteristics, your focus distance, and adjust the size of your bokeh with the aperture size, just like a real lens.
View OpticalZDefocus.md

OpticalZDefocus

OpticalZDefocus is a physically accurate ZDefocus, which controls circle of confusion size based on lens geometry using the depth of field equation.

  1. Set your focal length and film-back characteristics to match the lens that shot your plate
  2. Animate your focus distance
  3. Adjust the f-stop to match the size of your bokeh to your plate

Just like a real lens! (And using the same math :P )

Features

You can’t perform that action at this time.