Skip to content

Instantly share code, notes, and snippets.

@jedypod
jedypod / menu.py
Created May 11, 2020 03:32 — 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(
@jedypod
jedypod / nuke_viewer_shortcut_intercept.py
Created May 11, 2020 03:26 — forked from dbr/nuke_viewer_shortcut_intercept.py
Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""Test of finding Nuke's viewer widget, and intercepting the hardwired "c" shortcut and rewiring it to view the RGB channel
"""
from PySide import QtGui, QtCore
def findviewer():
stack = QtGui.QApplication.topLevelWidgets()
viewers = []
while stack:
@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' ]
@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 / rsync-time-machine.py
Created April 6, 2017 22:26
My linux rsync time machine script
#!/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:
@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