Skip to content

Instantly share code, notes, and snippets.

@kramester
kramester / SubmitNukeToDeadline.py
Last active July 13, 2023 11:40
Bootstrapping tk-nuke to deadline instances
# this code needs to be inserted into your SubmitNukeToDeadline script if you are using deadline's submission script.
###### INSERT AFTER THIS LINE, line 1308 in my file
#if groupBatch or dialog.separateJobs.value():
# fileHandle.write(EncodeAsUTF16String("BatchName=%s\n" % batchName))
# Populating environment variables from running Nuke:
# http://developer.shotgunsoftware.com/tk-core/platform.html#sgtk.platform.create_engine_launcher
current_engine = sgtk.platform.current_engine()
launcher = sgtk.platform.create_engine_launcher(
@dbr
dbr / coc_calcuation.py
Last active December 10, 2015 05:28
Camera near and far limit formula
from math import sqrt
# Camera parameters
focal = 25 #mm
fstop = 2.8 # f number
focus_distance = 5 # Unsure of unit? Probably mm, maybe metre?
# Circle of confusion diameter limit, as per
# http://en.wikipedia.org/wiki/Zeiss_formula (with modern 1500 constant)
filmback_width = 35