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
View Time offset start and end of all rotoshapes
# Time offset start and end of all rotoshapes
import nuke.rotopaint as rp, _curvelib as cl
# Amount of frames to offset
time_offset = -200
t = nuke.frame()
# Get all Roto or RotoPaint nodes and loop through them
roto_nodes = [n for n in nuke.allNodes() if 'Roto' in n.Class()]
for roto_node in roto_nodes:
View nan_inf_to_average
Expression {
expr0 "isinf(r) ? ((r(x+1,y)+r(x+1,y+1)+r(x+1,y-1)+r(x,y+1)+r(x,y-1)+r(x-1,y+1)+r(x-1,y)+r(x-1,y-1))/8) : r"
expr1 "isinf(g) ? ((g(x+1,y)+g(x+1,y+1)+g(x+1,y-1)+g(x,y+1)+g(x,y-1)+g(x-1,y+1)+g(x-1,y)+g(x-1,y-1))/8) : g"
expr2 "isinf(b) ? ((b(x+1,y)+b(x+1,y+1)+b(x+1,y-1)+b(x,y+1)+b(x,y-1)+b(x-1,y+1)+b(x-1,y)+b(x-1,y-1))/8) : b"
expr3 a
name infToAverage
selected true
xpos -68
ypos -273
jedypod / LeftHand_Shortcuts
Last active Aug 29, 2015
Map commonly used Nuke functionality to the left hand: frame advancing and stereo view-switching.
View LeftHand_Shortcuts
# Add these to the in your ~/.nuke or NUKE_PATH folder
# Viewer Shortcuts'Viewer').addCommand("Next Frame", lambda: nuke.activeViewer().frameControl(1), "shift+f")'Viewer').addCommand("Previous Frame", lambda: nuke.activeViewer().frameControl(-1), "shift+d")'Viewer').addCommand("Next Keyframe", lambda: nuke.activeViewer().frameControl(2), "ctrl+shift+f")'Viewer').addCommand("Previous Keyframe", lambda: nuke.activeViewer().frameControl(-2), "ctrl+shift+d")
# Swap stereo views: requires eyes to be named as lname and rname
lname = "L"
import nuke.rotopaint as rp, _curvelib as cl, nukescripts, nuke, math, time
class ShapePanel(nukescripts.PythonPanel):
def __init__(self, node):
nukescripts.PythonPanel.__init__(self, 'RotoPaint Elements')
self.rp_node = node
self.frame_range = nuke.String_Knob('frame_range', 'Frame Range', '{0}-{1}'.format(nuke.root().firstFrame(), nuke.root().lastFrame()))
self.type_filter_knob = nuke.Enumeration_Knob('element', 'Element Type', ['Shapes', 'Strokes'])
self.element_knob = nuke.Enumeration_Knob('curve', 'Curve', [])
self.cv_knob = nuke.Enumeration_Knob('cv', 'CV', [])
import nuke, operator
## Add these lines to your after putting this file somewhere in your NUKE_PATH
# Manipulate nodes in the node graph
import node_handler'Nuke').addCommand('Edit/Node/Move/Right', 'node_handler.move(1,0)', 'alt+meta+Right')'Nuke').addCommand('Edit/Node/Move/Left', 'node_handler.move(-1,0)', 'alt+meta+Left')'Nuke').addCommand('Edit/Node/Move/Up', 'node_handler.move(0,-1)', 'alt+meta+Up')
jedypod /
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.
import nuke
#'Nuke').findItem('Render').addCommand('Render Selected with Ranges', 'render_writes_with_ranges.render()')
def render():
gui_render = False
write_nodes = nuke.selectedNodes()
# Get all writes and frame ranges
writes = dict(zip([w for w in write_nodes], [w.frameRange() for w in write_nodes]))
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.
NoOp {
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
#!/usr/bin/env python
from __future__ import with_statement
import os, re, argparse
# Convert one machine code format to another -
# rename this with no py extension, make it executable, and put it in your bash PATH to make it a commandline tool
# This uses the argparse module to parse args to the commandline tool
parser = argparse.ArgumentParser()
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 /
Created Apr 6, 2017
My linux rsync time machine script
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, but using
more robust coding practices.
You can’t perform that action at this time.