Skip to content

Instantly share code, notes, and snippets.

View yuri-carrara's full-sized avatar

yuri carrara yuri-carrara

View GitHub Profile
@kpprt
kpprt / createExrCamVray.py
Created February 26, 2019 16:20
Generate a camera in Nuke from the metadata of an EXR sequence that is rendered with VRay in Maya.
# code copied and adapted from https://pastebin.com/4vmAmARU
# Big thanks to Ivan Busquets who helped me put this together!
# (ok, ok, he really helped me a lot)
# Also thanks to Nathan Dunsworth for giving me solid ideas and some code to get me started.
import math
def createExrCamVray( node ):
import nuke
def get_useless_nodes():
all_nodes = nuke.allNodes()
ignore_class_list = ['BackdropNode', 'Write', 'Viewer']
remove_list = []
for node in all_nodes:
@fredrikaverpil
fredrikaverpil / nuke_screengrab.py
Created October 26, 2016 06:25
Grab the viewer from Nuke
from PySide import QtGui
def grab_widget(widget=None, filepath=None):
"""This is a test and is not proofed for production
Note:
See QPixmap members being obsolete in Qt5:
http://doc.qt.io/qt-5/qpixmap-obsolete.html
"""
@danbradham
danbradham / nuke_copy_paste.py
Created August 5, 2016 20:12
Nuke python copy and paste at the specified position
import os
from PySide import QtGui
import nuke
import nukescripts
def copy_script():
nuke.nodeCopy('%clipboard%')
clipboard = QtGui.QApplication.clipboard()
script = clipboard.text()
@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:
@ppearson
ppearson / ImagineRenderIop
Last active November 26, 2021 07:54
ImagineRender_Iop
/*
Imagine
Copyright 2011 Peter Pearson.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@ishikawash
ishikawash / gist:3287209
Created August 7, 2012 16:46
bump mapping example ( calculating tangent vector by vertex shader )
// vertex shader
#version 120
uniform vec3 light_position; // in eye space
varying vec3 light_dir;
varying vec3 eye_dir;
varying vec2 uv;
vec3 calculate_tangent(vec3 n) {
@julik
julik / cornerpin_to_matrix.py
Created August 23, 2011 08:12
Nuke corner pin to matrix
# and here is the script in case anyone is interested :)
import nuke
def getTheCornerpinAsMatrix():
projectionMatrixTo = nuke.math.Matrix4()
projectionMatrixFrom = nuke.math.Matrix4()
#dir(projectionMatrix)
theCornerpinNode = nuke.selectedNode()
imageWidth = float(theCornerpinNode.width())
imageHeight = float(theCornerpinNode.height())