Skip to content

Instantly share code, notes, and snippets.

@dbr
dbr / gist:8016555
Created December 18, 2013 02:51
Get all files referenced by a Nuke file knob
def _collect_file_knob(node):
# disallow locally-cached paths, otherwise evaluating gives localised path
if node.knob('cacheLocal'):
orig = node['cacheLocal'].value()
node['cacheLocal'].setValue('never')
# Frame range to evaluate
fr = nuke.FrameRange(node['first'].value(), node['last'].value(), 1)
# Evaluation context thing, modified later
@dbr
dbr / nuke_transform_around_point.nk
Created December 12, 2013 06:51
Nuke transform around a specific origin
set cut_paste_input [stack 0]
version 7.0 v8
push $cut_paste_input
Axis2 {
translate {{parent.Axis1.translate} {parent.Axis1.translate} {parent.Axis1.translate}}
rotate {{parent.Axis1.rotate} {parent.Axis1.rotate} {parent.Axis1.rotate}}
scaling {{parent.Axis1.scaling} {parent.Axis1.scaling} {parent.Axis1.scaling}}
name Axis4
tile_color 0x3f3f3f00
gl_color 0x3f3f3fff
@dbr
dbr / object_local_cam.nk
Created December 12, 2013 01:22
Camera-local axis in nuke
set cut_paste_input [stack 0]
version 7.0 v5
push $cut_paste_input
Camera2 {
translate {{curve x1 5.579999924 x16 0.7399997115} {curve x1 1.559999943 x16 1.400000095} {curve x1 0 x16 3.070000172}}
rotate {{curve x1 -10.3695155 x16 3.204001185} {curve x1 52.93623369 x16 4.075417637} {curve x1 0 x16 7.911174182}}
name Camera1
label "Shot camera"
selected true
xpos -76
@dbr
dbr / Vagrantfile
Created December 5, 2013 12:20
Incomplete Vagrant VM config for testing OpenColorIO with GCC 4.1.2
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos-64-x64"
diff --git a/src/nuke/CMakeLists.txt b/src/nuke/CMakeLists.txt
index 81b2cd5..91d1a2d 100644
--- a/src/nuke/CMakeLists.txt
+++ b/src/nuke/CMakeLists.txt
@@ -11,7 +11,7 @@ include_directories(
###############################################################################
### NukeOCIOColorSpace ###
-add_library(NukeOCIOColorSpace MODULE
+add_library(NukeOCIOColorSpace SHARED
from PySide import QtGui
_testwidget_instance = None
class TestWidget(QtGui.QLabel):
def __init__(self, parent=None):
super(TestWidget, self).__init__(parent)
# There can be only one.. assuming this works..
global _testwidget_instance
@dbr
dbr / nuke_pty_test.py
Created October 15, 2013 02:44
Test of running Nuke in a psuedoterminal to capture progress info
"""Test of running Nuke in a psuedoterminal, in order to capture the
7% done, Time to go: 17 minutes, 53 seconds
..output
"""
raise Exception("This probably doesn't work very reliably, barely tested")
import os
@dbr
dbr / jenkins_delete_failed.groovy
Created September 9, 2013 12:52
Delete failed builds for a job in Jenkins
def job = Jenkins.instance.getItem("the_job_name")
job.getBuilds().each {
if(it.result == Result.FAILURE){
// Delete failed job
it.delete()
}
}
@dbr
dbr / inverting_linearlight.nk
Created July 12, 2013 05:58
Inverting linear images
#! Nuke7.0 -nx
version 7.0 v8
Root {
inputs 0
name /tmp/inverting_linearlight.nk
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
}
BackdropNode {
@dbr
dbr / nuke_viewer_shortcut_intercept.py
Created June 4, 2013 04:12
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: