Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / DepthSlice.nk
Last active December 4, 2017 00:01
Depth Slice is a simple gizmo to create a near, far, or centered slice with width and falloff controls.
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name DepthSlice
tile_color 0xcc804eff
addUserKnob {20 DepthSlice}
addUserKnob {41 depth t "Choose the depth channel to use for slicing." T CHAN_SEL.Zchan}
addUserKnob {41 channel t "Channel to output depth." -STARTLINE T OUTPUT_LAYER.out}
addUserKnob {26 "" +STARTLINE}
addUserKnob {4 method t "choose the type of output: slice, near slice, or far slice." M {slice near far}}
This file has been truncated, but you can view the full file.
@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}
##############################################################
# TMUX CONF JEDEDIAH
##############################################################
set-option -g prefix M-a
unbind-key M-a
bind-key M-a send-prefix
set -g base-index 1
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name CornerPinMatrix
help "<b>PlanarProjection</b>\n\nGenerates 2D coordinates for points in 3D space. Type in 3D point coordinates, or use vertex selection in 3D viewer and click set to pick average of selected points, or set points to set all four points at once. You can connect node output to scene together with your pointcloud or geometry and see where your points are located in 3d space. Double click any of them to move it in 3d space like any traditional nuke transform control.\n\nA matrix transform is also generated to be used with RotoPaint, SplineWarp and GridWarp nodes.\n\nIf you are using matrix in GridWarp, points have to be in clockwise order, pick them one by one! Command set points doesn't respect selection order!\n\nCheck out the demo video on my website!\n\nKudos to Ivan Busquets for help with matrix math.\n\n--\ndeveloped by Vit Sedlacek (c)2012\nwww.vitsedlacek.com\n\n-- \nModified by Jed Smith to make calculation time nearly ins
@jedypod
jedypod / Bake Roto
Last active June 5, 2018 20:05
Bake Roto is a python script that will bake an arbitrary control vertex on a Nuke Rotopaint shape or stroke into position data. Baking nearly instantaneous, and takes into account transforms for shapes parented under layers that have animations or expression links. The idea for this was based on Magno Borgo's BakeRotoShapesToTrackers script.
"""
Bake Roto is a python script that will bake an arbitrary control vertex on a Nuke Rotopaint shape or stroke into position data. Baking nearly instantaneous, and takes into account transforms for shapes parented under layers that have animations or expression links. The idea for this was based on <a href="http://www.borgo.tv/">Magno Borgo</a>'s BakeRotoShapesToTrackers script.
http://www.nukepedia.com/python/misc/bakerotoshapestotrackers/
Usage:
Select a Roto or RotoPaint node and run the script. Don't forget to turn on the "toolbar label points" button to see the cv numbers.
Example Installation:
Add code to your menu.py to add the script to a menu.
import bake_roto
@jedypod
jedypod / terminal_render.py
Last active August 28, 2018 01:08
Render Nuke jobs in the terminal on OSX and Linux
from __future__ import with_statement
import os
import sys
import re
import glob
import subprocess
import nuke
import nukescripts
@jedypod
jedypod / AutoExposure.nk
Last active November 29, 2018 21:45
Sample Color values of input averaging within a box size
Group {
name AutoExposure
addUserKnob {20 User}
addUserKnob {41 wb T ColorMatch.wb}
addUserKnob {41 dst_color l dst T ColorMatch.dst_color}
addUserKnob {22 calc T "n = nuke.thisNode()\nnuke.root().begin()\nn.begin()\nct = nuke.toNode('CURVETOOL')\nct\['intensitydata'].clearAnimated()\nt = nuke.frame()\nnuke.execute(ct, t, t)" +STARTLINE}
addUserKnob {26 ""}
addUserKnob {41 intensitydata T CURVETOOL.intensitydata}
addUserKnob {41 sample T ColorSampler.sample}
addUserKnob {26 ""}