This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 ): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import nuke | |
| def get_useless_nodes(): | |
| all_nodes = nuke.allNodes() | |
| ignore_class_list = ['BackdropNode', 'Write', 'Viewer'] | |
| remove_list = [] | |
| for node in all_nodes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from PySide import QtGui | |
| import nuke | |
| import nukescripts | |
| def copy_script(): | |
| nuke.nodeCopy('%clipboard%') | |
| clipboard = QtGui.QApplication.clipboard() | |
| script = clipboard.text() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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()) |