Skip to content

Instantly share code, notes, and snippets.

@sobotka
sobotka / bare-bones-ocio-configuration.py
Created March 23, 2020 16:33
Bare Bones OpenColorIO Configuration Generation via Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import PyOpenColorIO
import numpy
import colour
from colour import (
io,
adaptation,
models
@zachlewis
zachlewis / build_test_ocio2_config.py
Last active July 17, 2021 23:00
OCIO 2.0 test config
import PyOpenColorIO as ocio
import numpy as np
import colour as colour
from six import string_types
__version__ = "2020.11.08.0"
OUTPUT = "/tmp/test_config.ocio2"
@MichaelLawton
MichaelLawton / gist:ee27bf4a0f591bed19ac
Last active February 23, 2021 09:17
Installing Maya 2015 SP5 on Ubuntu 14.04 LTS with Student License. I recommend using my new gist instead: https://gist.github.com/MichaelLawton/32ca5cf6145f0ca4a7ebcdc510d7447d
#References:
#http://forums.autodesk.com/t5/installation-licensing/installing-maya-on-ubuntu/td-p/4905036
#http://askubuntu.com/questions/392806/installing-maya-on-ubuntu-linux
#https://gist.github.com/insomniacUNDERSCORElemon/5555214
#http://nealbuerger.com/2013/05/ubuntu-13-04-maya-2014-install-script/
#http://www.nkoubi.com/blog/tutorial/how-to-install-autodesk-maya-2011-on-debian-ubuntu/
#http://help.autodesk.com/view/MAYAUL/2015/ENU/?guid=GUID-E7E054E1-0E32-4B3C-88F9-BF820EB45BE5
#http://www.andrewhazelden.com/blog/2014/10/autodesk-nlm-licensing-issues-with-maya-2015-and-max-2015/
@dbr
dbr / menu.py
Created September 5, 2017 04:02
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(
@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
"""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:
@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 {
@tokejepsen
tokejepsen / batch_edit.py
Last active April 23, 2020 22:16
Nuke: Batch Edit Tool
import os
import difflib
import nuke
import nukescripts
class KnobsPanel(nukescripts.PythonPanel):
def __init__(self, knobs):
nukescripts.PythonPanel.__init__(self, 'KnobsPanel')
@dbr
dbr / nuke_duplicate_node.py
Created April 17, 2013 00:38
Duplicate a Nuke node
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():
@vfxwiki
vfxwiki / OpticalZDefocus.nk
Last active August 31, 2017 01:31 — forked from jedypod/OpticalZDefocus.md
OpticalZDefocus is a physically accurate ZDefocus, which controls circle of confusion (coc) size based on lens geometry using the depth of field equation. Set your lens and film-back characteristics, your focus distance, and adjust the size of your bokeh with the aperture size, just like a real lens.
# forked from Jedediah Smith https://gist.github.com/jedypod/50a3b68f9b5bbe487e1a
# modified by Rafal Kaniewski https://gist.github.com/vfxwiki/beac2c8c65f6a9d50d95d21e52a32ddb
set cut_paste_input [stack 0]
version 9.0 v8
push $cut_paste_input
Group {
name ZDefocusOptik
help "<b>OpticalZDefocus</b> is a physically accurate ZDefocus, which controls circle of confusion (coc) size based on lens geometry using the depth of field equation. \n\nSet your lens and film-back characteristics, your focus distance, and adjust the size of your bokeh with the aperture size, just like a real lens."
tile_color 0xff802bff
selected true