Skip to content

Instantly share code, notes, and snippets.

View greenvfx's full-sized avatar

Vitalii Musatov greenvfx

  • Industrial Light & Magic
  • Vancouver
  • LinkedIn in/vmusatov
View GitHub Profile
@greenvfx
greenvfx / Transform.cpp
Created March 20, 2023 02:23 — forked from jedypod/Transform.cpp
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
@greenvfx
greenvfx / menu.py
Created December 25, 2020 16:29 — forked from dbr/menu.py
Alternative viewer connection shorcuts - alt+1..9 connect viewer, 1..9 only switch viewer
def viewer_shotcuts_alt():
# Alt+1, Alt+2 etc to connect node to viewer
for n in range(9):
def connect_viewer(n=n):
selection = nuke.selectedNodes()
nuke.connectViewer(n, nuke.selectedNode())
[node.setSelected(False) for node in nuke.selectedNodes()]
[node.setSelected(True) for node in selection]
nuke.menu("Node Graph").addMenu("ViewerThing").addCommand(
@greenvfx
greenvfx / PlanarProjection.nk
Created December 25, 2020 16:25 — forked from jedypod/PlanarProjection.nk
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
@greenvfx
greenvfx / ToeReverse.nk
Created January 18, 2018 15:31 — forked from jedypod/ToeReverse.nk
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}
@greenvfx
greenvfx / raytracing.py
Created January 7, 2018 20:14 — forked from rossant/raytracing.py
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is