Skip to content

Instantly share code, notes, and snippets.

@jedypod
jedypod / DAILIES_CONFIG.yaml
Last active March 22, 2024 09:46
NOTE: if you stumbled here via google, this code has been moved to a proper git repo which is here: https://github.com/jedypod/generate-dailies - A tool to pipe openexr images, apply an ocio display, and output through a bash pipe to ffmpeg and encode to mov
globals:
# Path to the ocio config to use
ocioconfig: /path/to/config.ocio
# Default ocio profile to use if not specified on the commandline
ocio_default_transform: grade
###############################################
## Reformatting and Cropping
###############################################
# If debug is true, no encoding will be done and there will be debug prints
@jedypod
jedypod / CalibrateMacbeth.nk
Last active March 20, 2024 14:52
Calibrate Macbeth: a Nuke tool to calibrate an image containing a Macbeth ColorChecker chart by calculating a ColorMatrix node that conforms it to a specified colorspace gamut.
set cut_paste_input [stack 0]
version 14.0 v2
push $cut_paste_input
Group {
name CalibrateMacbeth
tile_color 0x87aee7ff
selected true
xpos 197
ypos -199
addUserKnob {20 CalibrateMacbeth}
@jedypod
jedypod / OpticalZDefocus.md
Last active March 14, 2024 05:42
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.

OpticalZDefocus

OpticalZDefocus UI

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
@jedypod
jedypod / README.md
Last active February 29, 2024 20:33
Nuke ffmpeg Render

Nuke ffmpeg Render

Writeffmpeg is a python script and a node that allows you to render from Nuke directly into ffmpeg. Instead of a 2 step process where you render from Nuke to a temporary image sequence that you then transcode using ffmpeg, this solution writes to a single uint16 cache tiff file and this data gets piped into ffmpeg.

I've included a little screen recordingto help demo how it works.

Files

ffmpeg_render.py Writeffmpeg.nk

Dependencies

@jedypod
jedypod / DistortTracks
Last active January 19, 2024 16:42
Distort Tracks Gizmo(Description in Comments, because description does not support markdown?)
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name DistortTracks
help "<b>Distort Tracks Gizmo</b>\n\n<b>About</b>:\nThis gizmo reformats and/or distorts tracking data based on a uv distortion map input. When you are working with CG elements in your comp that are undistorted and padded resolution, sometimes it is useful to reconcile tracking data from a 3d position through a camera into screen space. This data can then be used to do stuff in 2d: track in lens flares, matchmove roto or splinewarps, etc. The problem is that when this tracking data comes back from our padded undistorted 3d scene into distorted, unpadded resolution comp land, it doesn't line up. \n\n<b>Instructions</b>:\n1. Connect the UV input to a uv distortion map and set the channel that holds it, (for example, a LensDistortion node set to output type Displacement, outputting a UV distortion map into the forward.u and forward.v channels)\n2. Set the padded resolution format and the destination format: Padded resolution is the ov
@jedypod
jedypod / ExposureBlend.nk
Last active December 5, 2023 20:31
Nuke node to automate the blending of multiple bracketed exposures into a single high dynamic range hdr image. Includes a script to sort the input nodes based on exposure time.
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name ExposureBlend
label "\[value brackets] Brackets"
addUserKnob {20 ExposureBlend_tab l ExposureBlend}
addUserKnob {7 time_th l "time threshold" t "threshold duration in seconds between exposure bracket sets" R 1 10}
time_th 2
addUserKnob {1 capture_time l "capture time" t "Enter the metadata key for the exposure capture time metadata key in your source images"}
capture_time exr/Exif:DateTimeOriginal
@jedypod
jedypod / TonemapFilmic.nk
Created January 24, 2016 22:28
Tonemap Filmic - Implementing John Hable's Filmic Tonemapping algorithm as a Nuke gizmo.
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 / Transform.cpp
Last active October 23, 2023 09:21
Nuke blinkscript implementation of a simple image Transform operator. This blinkscript demonstrates pixel filter interpolation algorithms.
/*
Nuke blinkscript implementation of a simple image Transform operator.
Demonstrates pixel filter interpolation algorithms.
The following pixel filters are implemented:
0 - Blackman-Harris : Similar to cubic, but better performance in high frequencies
1 - Lanczos4 : 2x2 lanczos windowed sinc function
2 - Lanczos6 : 3x3 lanczos windowed sinc function
3 - Cubic : (Bicubic interpolation) - a=0.0, b=0.0
4 - Mitchell : (Bicubic interpolation) - a=1/3, b=1/3
@jedypod
jedypod / PlanarProjection.nk
Last active October 12, 2023 06:31
PlanarProjection Planar Projection Generates 2D coordinates for points in 3D space. Works on 4 points at once, is instantaneous to calculate, and generates a 4x4 transform matrix for use in rotos.
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name PlanarProjection
help "<b>Planar Projection</b>\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. \n\nYou 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. If you are using matrix in GridWarp, points have to be in clockwise order, pick them one by one! \n\nCommand set points doesn't respect selection order! \n\nCheck out the demo video on my website! Kudos to Ivan Busquets for help with matrix math. \n\n-- developed by Vit Sedlacek 2012 www.vitsedlacek.com \n\n-- Modified by Jed Smith to make calculation time nearly inst
@jedypod
jedypod / custom_ui_docked.py
Created April 22, 2020 18:55 — forked from fredrikaverpil/custom_ui_docked.py
Create custom PySide GUI and dock it into Nuke UI
import PySide.QtCore as QtCore
import PySide.QtGui as QtGui
from nukescripts import panels
class PanelTest(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout())
self.myTable = QtGui.QTableWidget()
self.myTable.header = ['Date', 'Files', 'Size', 'Path' ]