This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add these to the menu.py in your ~/.nuke or NUKE_PATH folder | |
# Viewer Shortcuts | |
nuke.menu('Viewer').addCommand("Next Frame", lambda: nuke.activeViewer().frameControl(1), "shift+f") | |
nuke.menu('Viewer').addCommand("Previous Frame", lambda: nuke.activeViewer().frameControl(-1), "shift+d") | |
nuke.menu('Viewer').addCommand("Next Keyframe", lambda: nuke.activeViewer().frameControl(2), "ctrl+shift+f") | |
nuke.menu('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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer