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
use rvtypes; | |
use app_utils; | |
use commands; | |
use extra_commands; | |
use rvui; | |
require math; | |
require io; | |
require qt; | |
require system; |
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
"""Broken-but-maybe-informative version of code from | |
http://stackoverflow.com/questions/13124235/python-process-communications-via-pipes-race-condition#13124235 | |
""" | |
import os | |
import string | |
def safe_write(*args, **kwargs): | |
while True: | |
try: |
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, QtCore | |
def findDagWidget(): | |
stack = QtGui.QApplication.topLevelWidgets() | |
while stack: | |
widget = stack.pop() | |
if widget.windowTitle() == 'Node Graph': | |
# You should probably be a little safer with this return, but the actual DAG widget | |
# seems to be here consistently... if not, it should be the only child of 'widget' |
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 duplicate_node(node, to_file = None): | |
"""Slightly convoluted but reliable(?) way duplicate a node, using | |
the same functionality as the regular copy and paste. | |
Could almost be done tidily by doing: | |
for knobname in src_node.knobs(): |
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
#! 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 { |
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
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 |
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
def root_settings_to_string(root): | |
"""Serialise the project settings. Used when writing the selected | |
nodes (otherwise things like the frame range would be lost) | |
""" | |
# Write non-default settings, in .nk script format. Also write | |
# user-knob definitons to avoid errors like NUKE-256 | |
rootstring = root.writeKnobs(nuke.TO_SCRIPT | nuke.WRITE_USER_KNOB_DEFS) | |
# TODO: Why doesn't writeKnobs write [first/last]_frame? Also |
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 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' ] |
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
""" | |
RGB to XYZ gamut-remapping matrix calculation. | |
Main function is rgb_to_xyz_matrix. | |
""" | |
class MatrixError(Exception): | |
pass | |
class NonInvertableMatrix(MatrixError): |
OlderNewer